Например:
@SubAnnotation
public class Test {
public static void main(String args[]){
Annotation[] annotations = Test.class.getAnnotations();
for(Annotation annot: annotations){
System.out.println(annot);
}
}
}
@Retention(RetentionPolicy.RUNTIME)
@SuperAnnotation
public @interface SubAnnotation {
}
Как получить SuperAnnotation в Test.class?