Skip to content
Sharp

Object-oriented programming · interview question

What keyword in Java is used to inherit from a superclass?

Multiple choiceEasychapter-5-curatedpremiumoopinheritance-basics
Choose one answer
Answer and explanation

Correct answer

D. Extends

Why

The 'extends' keyword is used to declare inheritance from a superclass in Java. It establishes an 'is-a' relationship between the subclass and the superclass.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →