Search Interview Questions
| 3356 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|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 Asked in 1 Companies|
Try 1 Question(s) Test
|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 ?|