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.

Works.java 730B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. public class Works {
  2. interface I {
  3. static final int CONST = 56;
  4. }
  5. static class A {
  6. protected int prot;
  7. protected String protS;
  8. int def;
  9. String defS;
  10. String foo;
  11. }
  12. static class B extends A 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 = 3;
  23. // super.defS = "3";
  24. // System.out.println(defS + def);
  25. // def = 4;
  26. // defS = "4";
  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. }