Metadatabase: the comment.
Metadata: data.
Different annotations will play a role in a period of no need. retentionpolicy. Source, retentionpolicy. Class, retentionpolicy. runtime are the source files in Java, class files, and bytecode in memory.
Override and suppresswarnings correspond to source, and deprecated corresponds to runtime,
In addition to the basic three types, there are:
@ Target meta Annotation
@ Target (elementtype. menthod) the specified annotation can only be used in methods.
@ Target ({elementtype. menthod, elementtype. Type}) the specified annotation can be used on both methods, subclass, interface, or enumeration.
Here elementtype is an enumeration class (★Generally, enumeration, interfaces, and comments are very similar to classes, but they are not classes but only types)
@ Retetion meta Annotation
@ Retention (retentionpolicy. runtime) This specifies the period in which the specified comment can be used.
In addition, we can customize annotations and create new annotations in myeclipse.
Annotation Note: Anno. Java
Use the annotated person class and assign a value to the annotation: person. Java
Define an enumeration class myname. Java
Demo1 class of the person class called by application reflection: demo1.java
Inherit the demo2: demo2.java subclass of the demo1 class