Skip to content
Sharp

Core Java · interview question

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

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

Correct answer

B. Default

Why

The 'default' keyword is used to define a default method in a Java interface, allowing the method to have an implementation.

Test yourself on Core Java

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

Start free test
All Core Java questions →