Skip to content
Sharp

Object-oriented programming · interview question

If a class implements two interfaces with methods that have the same signature, what must the class do?

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

Correct answer

D. Implement the method once, as the signature is identical

Why

When a class implements multiple interfaces with methods that have the same signature, it only needs to implement the method once. The same method implementation will satisfy both interface contracts.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →