Concept: Explanation of the program. For the computer to see.
Comments: Use words to describe the program for programmers to see.
Definition: Annotation, also called metadata. A code-level description. It is a feature introduced in JDK1.5 and later versions, and is at the same level as classes, interfaces, and enumerations. It can be declared in front of packages, classes, fields, methods, local variables, method parameters, etc., and is used to explain and annotate these elements.
Concept description:
New features after JDK1.5
Describe the
usage annotation of the program: @annotation name
Function classification:
①Writing documents: Generate documents through the annotations identified in the code [Generate document doc document] We cannot change it ourselves, such as @since;
② Code analysis: Analyze the code through the annotations identified in the code [Use reflection];
③ Compilation check: The compiler can implement basic compilation checks through the annotations identified in the code [Override] 】We can't change it ourselves, such as @override.
PHP Chinese website has a large number of free JAVA introductory tutorials, everyone is welcome to learn!
The above is the detailed content of java what are annotations. For more information, please follow other related articles on the PHP Chinese website!