=================================================================
When there is only one member, the member name must be taken as value (). You can assign a value directly when you use it!
Use the following:
=======================================
Note Classes can have no members, called identity annotations.
Use the following:
=======================
Annotations cannot be used for annotations of classes if the annotation scope has only methods and no classes:
Error in class use!
If the annotation scope has only classes, then annotations cannot be used for methods!
@Target defines a scope, preceded by a method, followed by a class.
================================================
Life cycle:
If the lifetime of the annotation is set to source, the runtime annotations will not exist, and the console will not have the parse result unless the source code is present:
If you change to class:
Must be an explanation of what the runtime is able to extract:
=====================
Inheritance of annotations:
Because it is an interface, inheritance does not work and the console has no output. The way to inherit from an interface does not work, and then it changes to a class to see: Changing the Person class to the Class,child class inherits the person class.
Console output:
Summary: Annotations inherit only the annotations above the class and do not inherit annotations on the method.
Java Custom Annotations