Skip to content
Sharp

Core Java · interview question

If a class implements two interfaces with conflicting default methods, how should it resolve the conflict?

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

Correct answer

C. By overriding the method in the class

Why

When a class implements multiple interfaces with conflicting default methods, it must override the method to resolve the conflict. This ensures that the class provides a clear implementation choice.

Test yourself on Core Java

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

Start free test
All Core Java questions →