You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Fails.java 719B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. public class Fails {
  2. interface I {
  3. static final int CONST = 56;
  4. }
  5. static class A<T> {
  6. protected int prot;
  7. protected String protS;
  8. int def;
  9. String defS;
  10. T foo;
  11. }
  12. static class B extends A<String> implements I {
  13. void m() {
  14. // protected
  15. // super.prot = 1;
  16. // super.protS = "1";
  17. // System.out.println(super.protS + super.prot);
  18. prot = 2;
  19. protS = "2";
  20. System.out.println(protS + prot);
  21. // default
  22. super.def = 1;
  23. super.defS = "1";
  24. System.out.println(defS + def);
  25. def = 2;
  26. defS = "2";
  27. foo = "todo";
  28. System.out.println(defS + def);
  29. // // interface
  30. // System.out.println(CONST);
  31. }
  32. }
  33. public static void main(String[] args) {
  34. B b = new B();
  35. b.m();
  36. }
  37. }