fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. interface Greeting{
  8. void print();
  9. }
  10. class Welcome{
  11. void show(){
  12. System.out.println("This is Welcome");
  13. }
  14. }
  15. class A1 extends Welcome implements Greeting{
  16. public void print(){
  17. System.out.println("This is Greeting");
  18. }
  19.  
  20. public static void main(String[] args){
  21. A1 obj=new A1();
  22. obj.print();
  23. obj.show();
  24. }
  25. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
This is Greeting
This is Welcome