MCQ
Single Best Answer
Easy
QWhich of these keywords is used to refer to member of base class from a sub class?
ID: #2242
Inheritance in Java MCQ
23,218 views
Question Info
#2242Q ID
EasyDifficulty
Inheritance in Java MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option B
Explanation
In Java, the super keyword is used by a subclass to directly access members (fields, methods, and constructors) of its immediate superclass. This is particularly useful when the subclass has overridden methods from the superclass and still needs to call the superclass's version of the method, or to pass arguments to the superclass constructor.
Explanation:
-
upper: This is not a keyword in Java. -
super: Correct answer. It is used to refer to members of the superclass from within a subclass. -
this: This keyword refers to the current instance of the class, not the superclass. -
none of the mentioned: This is incorrect, assuperis the correct answer.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic