1.

What is the scope of a class nested inside another class?(a) Protected scope(b) Private scope(c) Global scope(d) Depends on access specifier and inheritance usedI got this question by my college director while I was bunking the class.My question is taken from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

The correct ANSWER is (d) Depends on access specifier and inheritance USED

To explain I would SAY: It depends on the access specifier and the type of inheritance used with the class, because if the class is inherited then the nested class can be used by subclass too, provided it’s not of private type.



Discussion

No Comment Found

Related InterviewSolutions