fork download
  1. interface I
  2. {
  3. public void test();
  4. }
  5.  
  6. class A implements I
  7. {
  8. public void test() { System.out.println("A\n"); }
  9. }
  10.  
  11. class B extends A
  12. {
  13. public void test() { System.out.println("B\n"); }
  14. }
  15.  
  16. public class Main
  17. {
  18. public static void main(String[] args)
  19. {
  20. Main.doTest(new B());
  21. }
  22. public static void doTest(I i)
  23. {
  24. i.test();
  25. }
  26. }
  27.  
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
B