Skip to content
Sharp

Object-oriented programming · interview question

When a subclass overrides a superclass method, how can the original superclass method be accessed?

Multiple choiceMediumchapter-5-curatedpremiumoopmethod-overriding
Choose one answer
Answer and explanation

Correct answer

A. By using the super keyword followed by the method name.

Why

To access the original method from the superclass, the super keyword can be used in the subclass. This allows the subclass to call the original version of the method, preserving its behavior.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →