Skip to content
Sharp

Object-oriented programming · interview question

Which statement is true about interfaces in Java?

Multiple choiceMediumchapter-5-curatedpremiumoopinheritance-basics
Choose one answer
Answer and explanation

Correct answer

D. Interfaces can contain default methods with a body.

Why

Since Java 8, interfaces can contain default methods with a body, allowing them to provide a default implementation that can be overridden by implementing classes.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →