From a different
thread I opened, the following conclusion has
been reached (through experimentation of a number of people):
The inherited static members of inner classes may or may not be accessed depending on the particular compiler used.
javac 1.2.2 causes a compile-time error, whereas javac 1.3 and the compiler that comes with VisualAge 3.5 do not. JLS nowhere says that this should cause a compile-time error, but javac 1.2.2 causes one. Should we assume that a
java compiler *must* catch all compile-time errors specified in the JLS, but may catch more if it so wishes?
Any ideas?
Panagiotis.
<pre>
===================
class HasStatic {
public static void foo() {
System.out.println("I am static");
}
}
class Outer {
class Inner extends HasStatic {
}
}
class
Test {
public static void main(
String[] args) {
Outer.Inner.foo();
}
}
===================
</pre>