1.

Which of the members are referred by this pointer usually (Java)?(a) Members of class where this is used(b) Member of the parent class where this is used(c) Members that are passed as argument to the object(d) Pointers are not applicable in javaThe question was asked in a job interview.This intriguing question comes from Object Reference topic in division Object of Object Oriented Programming

Answer»

Correct option is (a) MEMBERS of class where this is USED

Explanation: We use this pointer to differentiate the members of the class where this is used to the other INHERITED or passed variables. The LOCAL variables are denoted with this. Or SPECIFICALLY the members of class only.



Discussion

No Comment Found

Related InterviewSolutions