Advertisement
fahimkamal63

Multiple Inheritance

Jun 21st, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. /**
  2.  * Multiple Inheritance
  3.  * Date : 22.06.19
  4.  */
  5. package pack1;
  6.  
  7. interface Father{
  8.     void father();
  9. }
  10.  
  11. interface Mother{
  12.     void mother();
  13. }
  14.  
  15. class Family implements Father,Mother{
  16.     public void father() { System.out.println("I am the father."); }
  17.     public void mother() { System.out.println("I am the mother."); }
  18.     public void son() { System.out.println("And I am the son."); }
  19.    
  20.     public static void main(String[] args){
  21.         Family ob = new Family();
  22.         ob.father();
  23.         ob.mother();
  24.         ob.son();
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement