Skip to content
Sharp

Object-oriented programming · interview question

Why do teams use interfaces over abstract classes in a Java application in production code?

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

Correct answer

B. Interfaces allow for implementing multiple types.

Why

Interfaces allow a class to implement multiple types, which is beneficial in Java since it supports multiple inheritance of type but not of implementation. This feature enhances flexibility and allows for more dynamic design patterns.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →