Examveda
Examveda

What is the purpose of the "protected" access modifier in Java inheritance?

A. To make a member visible to all classes in any package

B. To allow access to members within the same package and subclasses in any package

C. To hide a member from all subclasses

D. To make a member visible to all classes in any package

Answer: Option B


This Question Belongs to Java Program >> Inheritence

Join The Discussion

Related Questions on Inheritence

What is inheritance in Java?

A. The process of acquiring properties and behaviors of one class by another

B. The process of creating objects

C. The process of encapsulation

D. The process of overloading methods