Java annotations generally fall into three main categories:
1. Marking annotations
2. Tag meta annotations
3. General Notes
where 1. Tag annotations include
One override: Overriding methods in the superclass
Two Deprecated: Discarded classes
Three suppresswarings: Suppresses the compiler from issuing specific warnings
2. Tag meta annotations
A Generate: Identifies the source code generated by the computer
3. General Notes
A @Inherited tag inheritance relationship
Goal of the two @Target labeling
Three @Documented//Mark Generation Javadoc
Four @Retention (retentionpolicy.runtime)//lifetime of annotations
Instance:
1 Importjava.lang.annotation.Documented;2 Importjava.lang.annotation.Retention;3 ImportJava.lang.annotation.RetentionPolicy;4 5 //@Inherited Tag Inheritance relationships6 //@Target The target of the callout7@Documented//tag Generation Javadoc8@Retention (Retentionpolicy.runtime)//lifetime of the annotations9 Public@InterfacePerson {Ten String name (); One String Age (); A}
Called, where reflection is used
1 Importjava.lang.annotation.Documented;2 Importjava.lang.annotation.Retention;3 ImportJava.lang.annotation.RetentionPolicy;4 5 //@Inherited Tag Inheritance relationships6 //@Target The target of the callout7@Documented//tag Generation Javadoc8@Retention (Retentionpolicy.runtime)//lifetime of the annotations9 Public@InterfacePerson {Ten String name (); One String Age (); A}
java--Custom Annotations