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()?

Answers were Sorted based on User's Feedback



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

Answer / amarmca84

this() can be used to invoke a constructor of the same class
whereas super() can be used to invoke a super class constructor.

Is This Answer Correct ?    91 Yes 8 No

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

Answer / gcttcs

Super should be used only in the sub classes and super() is
used to point methods of super class. where as this can be
used in both super & sub classes and this() used to point
methods in the class where it is called.

Is This Answer Correct ?    28 Yes 6 No

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

Answer / prabu.b

1)Super() always calling the constructor of immediate
super class, super() must always be the first statements
executed inside a subclass constructor.

2)You cannot use this() and Super() in the same constructor.

Is This Answer Correct ?    23 Yes 4 No

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

Answer / tulasi prasad

this keyword is used to invoke the current class properties.
Where as super keyword is used to invoke the immidiate
super class properites.

Is This Answer Correct ?    17 Yes 2 No

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

Answer / 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

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

Answer / abc

this() is used to invoke default constructor of same class
And super() is used to invoke constructor of super class.

Is This Answer Correct ?    12 Yes 4 No

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

Answer / ajay yadav

super() immediately refers to the base class constructor to
initialize the variable.
this() refers to the current object.

Is This Answer Correct ?    10 Yes 3 No

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

Answer / srinu

this() can be used to invoke a constructor of the same class.
whereas super() can be used to invoke a super class constructor.

Is This Answer Correct ?    6 Yes 3 No

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

Answer / varunkumar

this keyword is used to invoke the current class properties.
Where as super keyword is used to invoke the immidiate
super class properites.
this keyword is same name of mathed and decleare value is
used the this class

Is This Answer Correct ?    1 Yes 0 No

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

Answer / bharathi raja

"this" refers to the current class where as "super" refers directly to its immediate above super class.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is finally in exception handling?

7 Answers  


Can I extend singleton class in java?

0 Answers  


Explain an intermediate language?

0 Answers  


Is java pass by value or pass by reference?

0 Answers  


Features of JAVA ? In which version of java synchronizedXXX() methods are included in Collections class.

1 Answers   NIIT,


What is the purpose of a statement block?

1 Answers  


why constructor dont have returns type?

9 Answers   IBM,


Can an unreachable object become reachable again?

3 Answers  


What is the syntax and characteristics of a lambda expression? Explain

0 Answers  


Is java a compiler?

0 Answers  


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

0 Answers  


I have a Arraylist object, it has duplecate values also. Now question is i want delete duplecate data in that objet with out using Set?

8 Answers   Aricent,


Categories