Asked by Stevi Green on Jun 05, 2024
Verified
A subclass can directly access ____.
A) public members of a superclass
B) private members of a superclass
C) all members of a superclass
D) none of the members of a superclass
Public Members
Members of a class (methods or variables) that are accessible from any other class.
Superclass
The class from which another class (subclass) inherits fields and methods in object-oriented programming.
- Gain knowledge about the levels of accessibility and their application within Java class structures.
Verified Answer
PS
Padhiyar ShantilalJun 12, 2024
Final Answer :
A
Explanation :
A subclass can directly access the public members of a superclass, but not the private members. It can also access protected members if the subclass is in the same package as the superclass, or if the subclass is a subclass of the superclass.
Learning Objectives
- Gain knowledge about the levels of accessibility and their application within Java class structures.