fork download
  1. public class Main {
  2. public static void main(String[] args){
  3. Printable obj = new A();
  4. obj.print();
  5. }
  6. }
  7.  
  8. class A implements Printable {
  9. public void print(){
  10. System.out.println("From a");
  11. }
  12. }
  13.  
  14. class B extends A {
  15. public void print(String str){
  16. System.out.println("Overriden");
  17. }
  18. }
  19.  
  20. interface Printable {
  21. public void print();
  22. }
Success #stdin #stdout 0.08s 212416KB
stdin
Standard input is empty
stdout
From a