Actually, when you define an annotation, you must specify the @Retention
parameter, which determines whether the annotation is available in the source code (SOURCE), in class files (CLASS), or at run time (RUNTIME).
@Retention(RetentionPolicy.RUNTIME) public @interface MyAnnotation {}
source share