1.

Which among the following best describes a nested class?(a) Class inside a class(b) Class inside a function(c) Class inside a package(d) Class inside a structureThe question was asked during an interview.My question comes from Nested Class in portion Class Members & Types of Object Oriented Programming

Answer»

Correct option is (a) CLASS inside a class

To EXPLAIN: If a class is DEFINED inside another class, the inner class is termed as nested class. The inner class is local to the enclosing class. SCOPE MATTERS a lot here.



Discussion

No Comment Found

Related InterviewSolutions