Demo01_Annotation.java 525 B

1234567891011121314151617181920
  1. package J20250807.annoation;
  2. import java.lang.annotation.*;
  3. /**
  4. * @author WanJl
  5. * @version 1.0
  6. * @title Demo01_Annotation
  7. * @description
  8. * @create 2025/8/7
  9. */
  10. //说明当前的Demo01_Annotation注解可以放在类上面、方法上面、成员变量上面
  11. @Target({ElementType.FIELD,ElementType.TYPE,ElementType.METHOD})
  12. //指定该注解的存活时间为一直到程序运行之后
  13. @Retention(RetentionPolicy.RUNTIME)
  14. @Inherited //表示这个注解可以被子类继承
  15. public @interface Demo01_Annotation {
  16. }