Skip to content
Sharp

Object-oriented programming · interview question

Which Java keyword would you use to define that a subclass method is providing its own implementation of a superclass method?

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

Correct answer

B. @Override

Why

The @Override annotation indicates that a method is intended to override a method in a superclass. It helps catch mis-matches in method signatures during compile time.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →