Skip to content

Instantly share code, notes, and snippets.

@LazaroIbanez
Created September 3, 2017 16:52
Show Gist options
  • Save LazaroIbanez/024b5fe11afd2d2f083de62f2613a76c to your computer and use it in GitHub Desktop.
Save LazaroIbanez/024b5fe11afd2d2f083de62f2613a76c to your computer and use it in GitHub Desktop.
Interfaces ambiguous fields
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