Name: igT44549 Date: 02/24/99
javac successfully compiles the program:
public class Test {
public class InnerTest {
public static final int ONE = 1;
}
public static void main(String[] args) {
System.out.println("InnerTest.ONE = " + InnerTest.ONE);
}
}
The inner classes spec from the JDK1.1.7 docs say:
"This shows why an inner class cannot declare a static member,
because the entire body of the inner class is in the scope of
one or more enclosing instances."
This is from innerclasses.doc6.html
As a side note, why don't the JDK1.2 docs hae any inner classes
specs?
(Review ID: 53258)
======================================================================
- relates to
-
JDK-6510286 Wording of javac error for inner classes
-
- Closed
-