fork download
  1. class A {
  2.  
  3. public void ml(){
  4. mx();
  5. }
  6.  
  7. public static void main(String[] args){
  8.  
  9. A a = ( B) new C();
  10. a.m1();
  11. B b = (B) new A();
  12. b.m1();
  13. }
  14.  
  15. public void mdx(){
  16. System.out.print(10);
  17. }
  18. }
  19.  
  20.  
  21. class B extends A{
  22. public void mx(){
  23. System.out.print(30);
  24. }
  25. }
  26.  
  27. class C extends B {
  28. public void mx(){
  29. System.out.print(40);
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:4: error: cannot find symbol
    mx();
    ^
  symbol:   method mx()
  location: class A
Main.java:10: error: cannot find symbol
    a.m1();
     ^
  symbol:   method m1()
  location: variable a of type A
Main.java:12: error: cannot find symbol
    b.m1();
     ^
  symbol:   method m1()
  location: variable b of type B
3 errors
stdout
Standard output is empty