Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

AnnotationTest1.java 842B

1234567891011121314151617181920212223242526272829303132333435
  1. public class AnnotationTest1 {
  2. @SomeAnnotation
  3. public void test() {
  4. System.out.println("test 1");
  5. }
  6. public static void main(String[] args) {
  7. //CASE 1
  8. AnnotationTest1 test1 = new AnnotationTest1();
  9. test1.test();
  10. //CASE 2
  11. AnnotationTest2<Integer> test2 = new AnnotationTest2<Integer>();
  12. test2.test2();
  13. //CASE 3
  14. AnnotationTest3 test3 = new AnnotationTest3();
  15. test3.test3();
  16. }
  17. public static class AnnotationTest2<Type extends Object> {
  18. @SomeAnnotation
  19. public void test2() {
  20. System.out.println("test 2");
  21. }
  22. }
  23. public static class AnnotationTest3 extends AnnotationTest2<Double> {
  24. @SomeAnnotation
  25. public void test3() {
  26. System.out.println("test 3");
  27. }
  28. }
  29. }