Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between this() and super()?

Answer Posted / ankita jain

super is the first statement of derived class constuctor.

class room
{
int l,b;
room(int x,int y)
{
l = x;
b = y;
}
void area()
{
int a;
a = l*b;
return(a);
}
}
class studyroom extend room
{
int h;
studyroom (int x ,int y, int z)
{
super(x,y)
z = h;
}
int volume()
{
int v;
v = l*b*h;
return(v);
}
}
class sup
{
public static void main(String args[])
{
int ar,vol;
studtroom s=new Studyroom()
ar = s.area();
vol = s.volume();
System.out.println("the area is = "+ar);
System.out.println("the volume is = "+vol);
}
}

Is This Answer Correct ?    24 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between string and stringbuffer?

1105


What is space character in java?

1088


When throw keyword is used?

1050


What are recursive functions?

1037


Does A Class Inherit The Constructors Of Its Superclass?

1050


What is an iterator interface in java programming?

936


Why do people says “java is robust”?

1013


What is the purpose of the wait(), notify(), and notifyall() methods in java programming?

1058


Difference between notify() method and notifyall() method in java?

953


Is it possible to instantiate the abstract class?

941


What is java util collection?

1064


What is main method?

1028


Which are the two subclasses under exception class?

1066


What is a string token?

1020


What is difference between java and java ee?

1011