import java.lang.annotation.Annotation; /** Prints the annotations a class carries, as the JVM reports them. Usage: java PrintAnnotations.java */ public class PrintAnnotations { public static void main(String[] args) throws Exception { Class type = Class.forName(args[0]); for (Annotation a : type.getAnnotations()) { System.out.println(a); } } }