-
Bug
-
Resolution: Fixed
-
P4
-
1.1, 1.1.4, 1.2.0
-
1.2beta3
-
generic, x86
-
generic, windows_95
-
Not verified
Name: mc57594 Date: 05/21/97
According to the rules for field access and expression
names, the following access to i in B is not ambiguous. The reason is
that although there are two i's in B, only one of them is accessible, so
there is no ambiguity.
package here;
interface I {
int i = 5; // public
}
public class Test {
static int i = 6; // default
}
public class B extends Test implements I {
// inherits a public i and a default i
}
package there;
class D extends here.B {
{ System.out.println(here.B.i); }
// JLS implies this is NOT ambiguous
// javac says it IS ambiguous!
}
======================================================================
- duplicates
-
JDK-4094618 Private field in superclass collides with public field in superinterface.
- Closed
-
JDK-4094624 Default access field inherited across package boundaries.
- Closed