1.

Static nested classes doesn’t have access to _________________ from enclosing class.(a) Private members(b) Protected members(c) Public members(d) Any other membersThis question was posed to me in an interview for internship.I'd like to ask this question from Nested Class topic in portion Class Members & Types of Object Oriented Programming

Answer»

The correct choice is (d) Any other members

Best explanation: The static nested class doesn’t have ACCESS to any other members of the ENCLOSING class. This is a rule that is made to ensure that only the data which can be COMMON to all the object is being ACCESSED by the static nested class.



Discussion

No Comment Found

Related InterviewSolutions