Before answering any question, you should answer in
this way [WHAT IS IT, WHEN TO USE IT, WHERE CAN WE USE IT
HOW TO USE IT ] If we cover all this, you will not miss any
topic in that question.
What is the this keyword?
In Java, the .this
keyword refers to the current object
We use it when a local variable and a class variable have
the same name, so it removes confusion. It is also used to
call another constructor in the same class, to pass the
current object to a method, or to return the current object
for method chaining. We mainly use this
in constructor and
instance methods, but not in static methods.in short this
makes the code clean, avoids ambiguity and helps in reusing
code
Everything starts with a small step, but you should start
Now, when you look back, you can see the progress
I have personally experienced this
Top comments (0)