O'Reilly logo

Core Java™ 2 Volume II - Advanced Features, Seventh Edition by Gary Cornell, Cay S. Horstmann

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

Standard Annotations

JDK 5.0 defines seven annotation interfaces. Three of them are regular annotations that you can use to annotate items in your source code. The other four are meta-annotations that describe the behavior of annotation interfaces. Table 13-1 shows these annotations. We discuss them in detail in the following two sections.

Table 13-1. The Standard Annotations
Annotation InterfaceApplicable ToPurpose
DeprecatedAllMarks item as deprecated
SuppressWarningsAll but packages and annotationsSuppresses warnings of the given type
OverrideMethodsChecks that this method overrides a superclass method
TargetAnnotationsSpecifies the items to which this annotation can be applied
RetentionAnnotationsSpecifies how long this annotation is retained

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