Top News

What is the purpose of ‘this’ keyword in java?

 



In Java, ‘this’ keyword refers to current instance of the object.
It is useful for differentiating between instance variables and local
variables.
It can be used to call constructors. Or it can be used to refer to the
instance.
In case of method overriding, this is used for falling the method of
current class.

Post a Comment

Previous Post Next Post