What does the keyword this refer to inside a Java instance method?
Correct answer C. The object on which the method was invoked
Explanation
Within an instance method or constructor, this is a reference to the current object, the one the method was invoked on. It does not mean the latest instance created, and it is not the class itself. Because no current object exists in a static context, using this inside a static method is a compile-time error.
Answer checked How we write and check questions
Discussion