Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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