In the code below, IDEA highlights an error for the field reference in SubClass, saying that it has private access in the super-class. The code actually compiles fine using Sun's Java 6 compiler (and I think in the latest Eclipse compiler).
Note that, if the reference is changed to simply "field" instead of "super.field", then there is a compilation error.
public class ContainerClass
{
private class SuperClass
{
privateint field;
}
private class SubClass extends SuperClass
{
private SubClass()
{
System.out.println(super.field);
}
}
}
Description
In the code below, IDEA highlights an error for the field reference in SubClass, saying that it has private access in the super-class. The code actually compiles fine using Sun's Java 6 compiler (and I think in the latest Eclipse compiler).
Note that, if the reference is changed to simply "field" instead of "super.field", then there is a compilation error.
public class ContainerClass
{
private class SuperClass
{
privateint field;
}
private class SubClass extends SuperClass
{
private SubClass()
{
System.out.println(super.field);
}
}
}