import java.lang.annotation.Annotation; public class NonInheritedTest { public static void main(String[] args) { Annotation[] anns = Sample.class.getAnnotationsByType(NonInheritedAnnotationRepeated.class); for (Annotation a: anns ) { System.out.println(a.toString()); } } @NonInheritedAnnotationRepeated(name="A") @NonInheritedAnnotationRepeated(name="B") class Parent {} class Sample extends Parent {} }