Skip to content

Instantly share code, notes, and snippets.

@LazaroIbanez
Created September 3, 2017 16:01
Show Gist options
  • Save LazaroIbanez/af49dbe1ee3a3b604f8906fedb5f681e to your computer and use it in GitHub Desktop.
Save LazaroIbanez/af49dbe1ee3a3b604f8906fedb5f681e to your computer and use it in GitHub Desktop.
Use of super in interfaces
public class F implements InterfaceB {
public void m1() {
//super.m1();//This is NOT valid.
//InterfaceA.super.hello(); //This is NOT valid because F does not implement InterfaceA.
InterfaceB.super.m1(); //This is valid.
}
}
interface InterfaceA {
default void m1() {}
}
interface InterfaceB extends InterfaceA {
default void m1() {
//super.hello(); //This is NOT valid.
InterfaceA.super.m1(); //This is valid.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment