Chapter 11 ▪ Annotations
Annotations are tags that you insert into your source code so that some tool can process them. The tools can operate on the source level, or they can process class files into which the compiler has placed annotations.
Annotations do not change the way your programs are compiled. The Java compiler generates the same virtual machine instructions with or without the annotations.
To benefit from annotations, you need to select a processing tool and use annotations that your processing tool understands, before you can apply that tool to your code.
There is a wide range of uses for annotations. For example, JUnit (available at https://junit.org) uses annotations to mark methods that execute tests and to specify how the tests ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access