1.

Which specifier can be used to inherit protected members as protected in subclass but public as public in subclass?(a) Private(b) Default(c) Public(d) ProtectedThis question was addressed to me in an international level competition.This interesting question is from Public Access Specifier topic in chapter Access Specifiers of Object Oriented Programming

Answer»

Right ANSWER is (c) Public

The explanation: The SPECIFIER that can make PROTECTED member’s protected in subclass and public member’s public in subclass, is public. This is DONE to maintain the security LEVEL of protected members of parent class.



Discussion

No Comment Found

Related InterviewSolutions