fork download
  1. class A
  2. {
  3. int i = 5;
  4. }
  5.  
  6. class B extends A
  7. {
  8. String i = "s";
  9.  
  10. void m()
  11. {
  12. System.out.println(((A)this).i);
  13. System.out.println(i);
  14. }
  15. }
  16.  
  17. class Main
  18. {
  19. public static void main (String[] args)
  20. {
  21. B b = new B();
  22. b.m();
  23. A a = b;
  24. System.out.println(a.i);
  25. System.out.println(b.i);
  26. }
  27. }
Success #stdin #stdout 0.07s 381184KB
stdin
Standard input is empty
stdout
5
s
5
s