--- title: Java Programming 2 - Reflection & Annotation tags: java, computer science --- # Reflection & Annotation ## Reflection * Run-Time Type Information (RTTI) ## Applications * javadoc * JUnit * reflection + annotation ```java= @interface NewAnnotation { int id(); String name(); } @NewAnnotation(id = 100, name = "Arthur") class NewObject {} public class Demo { public static void main(String[] args) { Class<?> clz = class.forName(NewAnnotation.class); // to be continued. } } ```