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.

ReadWriteAJBug172107.java 643B

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