Skip to content
Sharp

Core Java · interview question

In a class hierarchy, which rule determines method resolution if both a superclass and an interface provide implementations?

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

Correct answer

A. Superclass methods take precedence over interface methods.

Why

In Java, a class method overrides any default method provided by an interface, following the 'class wins over interface' rule.

Test yourself on Core Java

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

Start free test
All Core Java questions →