Skip to content
Sharp

Object-oriented programming · interview question

Why does marker interfaces in Java matter in this design?

Multiple choiceMediumchapter-5-curatedpremiumoopinterfaces
Choose one answer
Answer and explanation

Correct answer

D. To convey metadata or information without defining any methods

Why

Marker interfaces in Java are used to convey metadata or information. They don't contain any methods, but their presence allows the Java runtime or frameworks to provide special behavior or processing.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →