Skip to content

Instantly share code, notes, and snippets.

@Kaushal28
Created July 16, 2019 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaushal28/164f678c892d94b503a743ce55112f78 to your computer and use it in GitHub Desktop.
Save Kaushal28/164f678c892d94b503a743ce55112f78 to your computer and use it in GitHub Desktop.
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