Skip to content
Sharp

Object-oriented programming · interview question

In Java, what allows a class to inherit methods from multiple sources?

Multiple choiceEasychapter-5-curatedpremiumoopcomposition-vs-inheritance
Choose one answer
Answer and explanation

Correct answer

B. Implementing multiple interfaces.

Why

Java supports multiple inheritance of behavior through interfaces. A class can implement multiple interfaces, allowing it to inherit method signatures from multiple sources, which is not possible with classes as Java does not support multiple class inheritance.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →