1.

Which keyword is used by the method to refer to the object that invoked it?(a) import(b) catch(c) abstract(d) thisI had been asked this question in an interview.This question is from Constructors & Garbage Collection in section Classes and Methods of Java

Answer»

The correct answer is (d) this

The best I can explain: this KEYWORD can be used INSIDE any method to refer to the current OBJECT. this is always a reference to the object on which the method was INVOKED.



Discussion

No Comment Found

Related InterviewSolutions