mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-30 05:06:01 +07:00
e5e87e397d
GitOrigin-RevId: 0076510ca5814c3db0a12d25aeea0e4105a6f4f5
31 lines
565 B
Java
31 lines
565 B
Java
|
|
class MultipleInheritance {
|
|
interface A {
|
|
int X = 1;
|
|
String FOO = "foo";
|
|
}
|
|
|
|
interface B extends A {
|
|
int X = 2;
|
|
String FOO = "foo";
|
|
}
|
|
|
|
interface C extends A, B {
|
|
int Y = C.<error descr="Reference to 'X' is ambiguous, both 'A.X' and 'B.X' match">X</error>;
|
|
String BAR = C.<error descr="Reference to 'FOO' is ambiguous, both 'A.FOO' and 'B.FOO' match">FOO</error>.substring(1);
|
|
}
|
|
}
|
|
|
|
class Shadowing {
|
|
interface A {
|
|
int X = 1;
|
|
}
|
|
|
|
interface B extends A {
|
|
int X = 2;
|
|
}
|
|
|
|
interface C extends B {
|
|
int Y = C.X;
|
|
}
|
|
} |