If The Protected Members Are To Be Made Accessible Only To The #229
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?
This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 OOps Access Specifiers - OOPs MCQ: Protected Access Specifier - Quiz No.1.
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?
The sub class should inherit the parent class privately
The sub class should inherit the parent class as protected
The sub class should inherit the parent class as public
The sub class can use any access modifier