Skip to content
Sharp

Object-oriented programming · interview question

Given two interfaces with default methods of the same signature, how can a class implementing both resolve the method conflict?

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

Correct answer

D. The class must override the conflicting method.

Why

When a class implements two interfaces with default methods of the same signature, it must override the method to resolve the conflict and provide a specific implementation.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →