Thursday, 12 February 2015

Multiple Inheritance through Interfaces

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

No comments:

Post a Comment