fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.lang.annotation.*;
  4.  
  5. public class Main {
  6.  
  7. @Retention(RetentionPolicy.RUNTIME)
  8. public @interface NewAnnotationType {
  9. }
  10.  
  11. @NewAnnotationType
  12. public class NewClass {
  13. public void DoSomething() {}
  14. }
  15.  
  16. public static void main(String[] args) {
  17. Class<NewClass> newClass = NewClass.class;
  18.  
  19. for (Annotation annotation : newClass.getDeclaredAnnotations()) {
  20. System.out.println(annotation.toString());
  21. }
  22. }
  23. }
  24.  
Success #stdin #stdout 0.09s 380352KB
stdin
Standard input is empty
stdout
@Main$NewAnnotationType()