If the protected members are to be made accessible only to the nearest subclass and no further subclasses, which access specifier should be used in inheritance?
(a) The sub class should inherit the parent class privately
(b) The sub class should inherit the parent class as protected
(c) The sub class should inherit the parent class as public
(d) The sub class can use any access modifier
The question was posed to me in an interview for job.
Origin of the question is Protected Access Specifier in chapter Access Specifiers of Object Oriented Programming