Skip to content
Sharp

Core Java · interview question

What happens if a class implements two interfaces, each with a default method with the same signature?

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

Correct answer

A. The class must override the method to resolve the conflict.

Why

When a class implements two interfaces with conflicting default methods, it must override the method to provide its own implementation and resolve the conflict.

Test yourself on Core Java

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

Start free test
All Core Java questions →