Capgemini Interview Question

What is the use of this keyword in java

Interview Answer

Anonymous

Mar 14, 2020

Keyword 'THIS' in Java is a reference variable that refers to the current object. "this" is a reference to the current object, whose method is being called upon. You can use "this" keywordto avoid naming conflicts in the method/constructor of your instance/object.