Skip to content
Sharp

Core Java · interview question

Which Java keyword would you use to declare a default method in a Java interface?

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

Correct answer

A. Default

Why

The 'default' keyword is used to declare a default method in a Java interface. It indicates that the method has a default implementation, which can be used by implementing classes.

Test yourself on Core Java

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

Start free test
All Core Java questions →