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 ?
Javasearch.buggybread.com

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. 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 ?
Ans. It makes no difference whether we add this to the variable or not. The only use of this is in the cases where there are multiple variables with the same name and we want to distinguish between the member variable and local variable. In case this is not added ,this is automatically added by the compiler in the byte code.

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

   Like         Discuss         Correct / Improve     this keyword  member elements  member variables


Related Questions

  Interface can only have ...
 Why it's a good practice to expose member elements through getter methods ?
 What will happen if we have our own constructor but only initialize some of the member elements ?



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: