Skip to content
Sharp

Java Annotations · interview question

What does the @Target annotation specify?

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

Correct answer

A. Where an annotation can be applied

Why

@Target specifies where an annotation can be applied, such as 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 →