Skip to content

Instantly share code, notes, and snippets.

@juliofalbo
Created October 11, 2019 19:32
Show Gist options
  • Save juliofalbo/ba11305cfbd52ab8d39628b1ec69b24e to your computer and use it in GitHub Desktop.
Save juliofalbo/ba11305cfbd52ab8d39628b1ec69b24e to your computer and use it in GitHub Desktop.
DefaultMethodMultipleInheritance.java
interface OneInterface {
default void defaultMethod(){
System.out.println("One");
}
}
interface TwoInterface {
default void defaultMethod(){
System.out.println("Two");
}
}
class SomeClass implements OneInterface, TwoInterface {
@Override
public void defaultMethod() {
OneInterface.super.defaultMethod();
TwoInterface.super.defaultMethod();
System.out.println("Three");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment