Skip to content
Sharp

Object-oriented programming · interview question

How would you explain a valid reason to use default methods in interfaces in a Java interview?

Multiple choiceHardchapter-5-curatedpremiumoopinterfaces
Choose one answer
Answer and explanation

Correct answer

B. To add new methods to interfaces without breaking existing implementations

Why

Default methods in interfaces allow developers to add new methods to interfaces without breaking existing implementations. They provide a default implementation that can be overridden if needed.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →