Skip to content
Sharp

Core Java · interview question

How can a class implementing an interface with a default method call that method from within an overridden method?

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

Correct answer

C. Using InterfaceName.super.methodName()

Why

To call a default method from an interface within a class that overrides it, use InterfaceName.super.methodName(). This syntax allows the class to specify which interface's default method to invoke.

Test yourself on Core Java

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

Start free test
All Core Java questions →