Java – This MCQ

In Java, this is a reference variable that refers to the current object of the class. It is used to differentiate between instance variables and parameters when they have the same name. Additionally, this can be used to invoke the current object’s methods and constructors, helping in scenarios where clarity is needed, especially within constructors or setters.

Loading...