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

Discuss about garbage collector in Java.

1031


What are the basics of core java?

964


Which one will take more memory: an int or integer?

1163


What is the epoch date?

956


What is the advantage of OOP in java?

1087


What are the differences between this and super keyword?

898


Can we use both this () and super () in a constructor?

967


What is anagram word?

954


What are the characteristics of java?

983


What is mysql driver class name?

1081


What is difference between calling start() and run() method of thread?

1036


Who is the owner of java?

953


What is the difference between form & report?

990


What is yield () in java?

835


What is difference between stringbuffer and string?

900