Created
September 3, 2017 16:52
-
-
Save LazaroIbanez/024b5fe11afd2d2f083de62f2613a76c to your computer and use it in GitHub Desktop.
Interfaces ambiguous fields
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
class C implements I1, I2 { | |
public void m1() {} | |
public static void main(String… args) { | |
C tc = new C(); | |
System.out.println(( ( I1) tc).VALUE); | |
} | |
} | |
interface I1 { | |
int VALUE = 1; | |
void m1(); | |
} | |
interface I2 { | |
int VALUE = 2; | |
void m1(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment