fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. B b = new B();
  9. b.changeAge();
  10. b.printAge();
  11. }
  12. }
  13.  
  14. class A {
  15. protected int Age;
  16. public void printAge(){
  17. System.out.println(Age);
  18. }
  19. }
  20.  
  21. class B extends A {
  22. public void changeAge(){
  23. Age = 11;
  24. }
  25. }
Success #stdin #stdout 0.06s 380160KB
stdin
Standard input is empty
stdout
11