fork download
  1.  
  2. interface MyInterface
  3. {
  4. public void run ( ) ;
  5.  
  6. public void run2();
  7. }
  8.  
  9. class MyClass // does not implement MyInterface
  10. {
  11. public void run ( )
  12. {
  13. System . out . println ( "Hello World!!!" ) ;
  14. }
  15. }
  16.  
  17. class MyImplementationClass extends MyClass implements MyInterface
  18. {
  19. // no implementation of run() here
  20.  
  21. // implements run2()
  22. public void run2() {
  23. System . out . println ( "Hello World from run2!!!" ) ;
  24. }
  25. }
  26.  
  27. class Main
  28. {
  29. public static void main ( String [ ] args )
  30. {
  31. new MyImplementationClass ( ) . run ( ) ;
  32.  
  33. new MyImplementationClass ( ) . run2 ( ) ;
  34. }
  35. }
  36.  
Success #stdin #stdout 0.07s 54596KB
stdin
Standard input is empty
stdout
Hello World!!!
Hello World from run2!!!