Home  >  Article  >  Java  >  java what are annotations

java what are annotations

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-12-27 10:32:513365browse

java what are annotations

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn