Skip to content
Sharp

Java Annotations · interview question

In a mini-framework using reflection, what is a key advantage of using annotations over configuration files?

Multiple choiceHardchapter-16-curatedpremiumjava-annotationscustom-annotations
Choose one answer
Answer and explanation

Correct answer

D. Annotations reduce the need for external configuration and make code more self-contained.

Why

Annotations allow metadata to be embedded directly in the code, making it easier to maintain and understand without separate configuration files.

Test yourself on Java Annotations

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

Start free test
All Java Annotations questions →