Thursday, 12 February 2015

InterfacesDemo

  1. interface Printable{  
  2. void print();  
  3. }  
  4.   
  5. interface Showable{  
  6. void show();  
  7. }  
  8.   
  9. class A7 implements Printable,Showable{  
  10.   
  11. public void print(){System.out.println("Hello");}  
  12. public void show(){System.out.println("Welcome");}  
  13.   
  14. public static void main(String args[]){  
  15. A7 obj = new A7();  
  16. obj.print();  
  17. obj.show();  
  18.  }  

No comments:

Post a Comment