asked 43.6k views
4 votes
The keyword super cannot be used to access base class members that are marked as ______

1 Answer

1 vote

Final answer:

The 'super' keyword cannot be used to access base class members that are marked as 'private'. 'Super' is used in subclasses to refer to their superclass except for the private members, which are not visible outside the class in which they are declared.

Step-by-step explanation:

The keyword super cannot be used to access base class members that are marked as private in object-oriented programming languages such as Java. The super keyword is designed to refer to the superclass (also known as the parent class) from which the current class is derived.

This allows the subclass to access and use the methods and fields of its superclass. However, it cannot access private members of the superclass because the private access modifier restricts the visibility to only within the class where it is declared.

answered
User Xwhyz
by
8.1k points

No related questions found

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.