Skip to content
Sharp

Java Annotations · interview question

Which of the following is NOT a valid target for an annotation?

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

Correct answer

C. Exception

Why

Annotations cannot directly target exceptions as exceptions are instances, not structural elements like methods, fields, or classes.

Test yourself on Java Annotations

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

Start free test
All Java Annotations questions →