Difference Between this() and super() ?

Search Interview Questions

 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text


Interview Questions and Answers

 Q1. Difference Between this() and super() ?Core Java
Ans. 1.this is a reference to the current object in which this keyword is used whereas super is a reference used to access members specific to the parent Class.

2.this is primarily used for accessing member variables if local variables have same name, for constructor chaining and for passing itself to some method whereas super is primarily used to initialize base class members within derived class constructor.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   class   objects   inheritence   constructor   this   super   this vs super     Asked in 1 Companies

Try 1 Question(s) Test

Related Questions

  Why can't we use this in static context ?
  Can we use "this" within static method ? Why ?
  In majority of the situations it won't make much sense whether you append this with the instance method call.Can you tell a situation wherein this keyword would make sense in a instance method ?
  Which of the following is not the use of this keyword ?
 Does compiler treats it differently if we don't prefix this to the member element and its implicit as its the only variable available with that name ?
 What is the use of this keyword in javascript ?

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: