Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Multiple Inheritance
- * Date : 22.06.19
- */
- package pack1;
- interface Father{
- void father();
- }
- interface Mother{
- void mother();
- }
- class Family implements Father,Mother{
- public void father() { System.out.println("I am the father."); }
- public void mother() { System.out.println("I am the mother."); }
- public void son() { System.out.println("And I am the son."); }
- public static void main(String[] args){
- Family ob = new Family();
- ob.father();
- ob.mother();
- ob.son();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement