Created
September 3, 2017 16:01
-
-
Save LazaroIbanez/af49dbe1ee3a3b604f8906fedb5f681e to your computer and use it in GitHub Desktop.
Use of super in interfaces
This file contains 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
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