O'Reilly logo

The Java® Language Specification, Java SE 7 Edition, Fourth Edition by Alex Buckley, Gilad Bracha, Guy Steele, Bill Joy, James Gosling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.6. Annotation Types

An annotation type declaration is a special kind of interface declaration. To distinguish an annotation type declaration from an ordinary interface declaration, the keyword interface is preceded by an at-sign (@).

Note that the at-sign (@) and the keyword interface are two distinct tokens. Technically it is possible to separate them with whitespace, but this is discouraged as a matter of style.

AnnotationTypeDeclaration:    InterfaceModifiersopt @ interface Identifier AnnotationTypeBodyAnnotationTypeBody:    { AnnotationTypeElementDeclarationsopt }AnnotationTypeElementDeclarations:    AnnotationTypeElementDeclaration    AnnotationTypeElementDeclarations AnnotationTypeElementDeclaration

If an annotation a9.7) on an annotation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required