Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jpt1122/6619191 to your computer and use it in GitHub Desktop.
Save jpt1122/6619191 to your computer and use it in GitHub Desktop.
class Child extends Parent{
}
/**
* @param args
*/
public static void main(String[] args) {
Parent parent = new Parent();
Child child = new Child();
System.out.println("Parent class:");
System.out.println(" getDeclaredAnnotations: " +
parent.getClass().getDeclaredAnnotations().length);
System.out.println(" getAnnotations: " +
parent.getClass().getAnnotations().length + "\n");
System.out.println("Child class:");
System.out.println(" getDeclaredAnnotations: " +
child.getClass().getDeclaredAnnotations().length);
System.out.println(" getAnnotations: " +
child.getClass().getAnnotations().length);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment