Skip to content
Sharp

Core Java · interview question

Why can using default methods in Java interfaces become a problem in production code?

Multiple choiceMediumchapter-5-curatedpremiumcore-javadefault-methods-and-multiple-inheritance
Choose one answer
Answer and explanation

Correct answer

B. They can complicate diamond inheritance issues

Why

Default methods can introduce complexity, especially with diamond inheritance, where a class implements two interfaces with the same default method. This requires the class to resolve which method to use.

Test yourself on Core Java

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

Start free test
All Core Java questions →