fork(354) download
  1. class Base {
  2. public void fun()
  3. {
  4. System.out.println("Base fun");
  5. }
  6. }
  7.  
  8. class Derived extends Base {
  9. public void fun()
  10. {
  11. System.out.println("Derived fun");
  12. }
  13. public static void main(String[] args) {
  14. Base obj = new Derived();
  15. obj.fun();
  16. }
  17. }
  18.  
  19.  
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Derived fun