| This Chapter | |
| - | Appendix C: Annotations |
| - | An Overview of Annotations |
| - | Standard Annotations |
| - | Standard Meta-Annotations |
| - | Custom Annotation Types |
A new feature in Java 5, annotations are notes in Java programs to instruct the Java compiler to do something. You can annotate any program elements, including Java packages, classes, constructors, fields, methods, parameters, and local variables. Java annotations are defined in JSR 175 (http://www.jcp.org/en/jsr/detail?id=175). Java 5 provided three standard annotations and four standard meta-annotations. Java 6 added dozens, discussed throughout this book.
This appendix is for you if you upgraded from JDK 1.4 to Java 6, skipping Tiger. It tells you everything you need to know about annotations and annotation types, so you won’t have problems understanding Java 6 new features, which are often embellished with annotations. It starts with an overview of annotations, and then teaches you how to use the standard annotations in Java 5. It concludes with a discussion of custom annotations.