Skip to content
Sharp

Java Annotations · interview question

Which retention policy for annotations if none is specified is the default in Java?

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

Correct answer

B. CLASS

Why

If no retention policy is specified, the default is CLASS, meaning the annotation is recorded in the class file but not available at runtime.

Test yourself on Java Annotations

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

Start free test
All Java Annotations questions →