Created
July 16, 2019 17:17
-
-
Save Kaushal28/164f678c892d94b503a743ce55112f78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface one { | |
public void printOne(); | |
} | |
interface two { | |
public void printTwo(); | |
} | |
interface three extends one, two{ | |
public void printThree(); | |
} | |
class Multiple implements three { | |
@Override | |
public void printOne() { | |
System.out.println("ONE"); | |
} | |
@Override | |
public void printTwo() { | |
System.out.println("TWO"); | |
} | |
@Override | |
public void printThree() { | |
System.out.println("THREE"); | |
} | |
//Own method | |
public void printFour() { | |
System.out.println("FOUR"); | |
} | |
} | |
public class MultipleInheritance { | |
public static void main(String[] args){ | |
Multiple m = new Multiple(); | |
m.printOne(); | |
m.printTwo(); | |
m.printThree(); | |
m.printFour(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment