Home

This Chapter
-Appendix C: Annotations
-An Overview of Annotations
-Standard Annotations
-Standard Meta-Annotations
-Custom Annotation Types

Table of Contents
-Introduction
-Chapter 1: Core Libraries
-Chapter 2: Dynamic Compilation
-Chapter 3: Scripting
-Chapter 4: Networking
-Chapter 5: Swing Updates
-Chapter 6: Abstract Window Toolkit
-Chapter 7: Internationalization
-Chapter 8: Java Database Connectivity 4.0
-Chapter 9: XML Digital Signature API
-Chapter 10: Streaming API for XML
-Chapter 11: Java Architecture for XML Binding
-Chapter 12: Web Services
-Chapter 13: JavaBeans Activation Framework
-Chapter 14: User-Defined MXBeans
-Chapter 15: Concurrency Updates
-Appendix A: Enums
-Appendix B: Generics
-Appendix C: Annotations

Previous
Next

 

Appendix C

Annotations

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.

Previous
Next