Skip to content
Sharp

Core Java · interview question

How can a class explicitly call a default method from an interface it implements?

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

Correct answer

C. Using 'super' with the interface name

Why

A class can call a default method from an interface it implements by using the syntax: InterfaceName.super.methodName(). This allows the class to access the specific default implementation of the method.

Test yourself on Core Java

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

Start free test
All Core Java questions →