Community
Participate
Working Groups
1 - Public class with inner class which contains a static int package com.kainos.solas.test; public class TestParentClass { public TestParentClass(){} public class TestInnerClass { public final static int i = 0; } } 2 - Try and reference the int from another class package com.kainos.solas.test; public class CallInnerClass { TestParentClass tpc = new TestParentClass(); int a = tpc.TestInnerClass.i; } ** ECLIPSE SAYS - tpc.TestInnerClass cannot be resolved or is not a field
Such a reference is forbidden as per JLS 6.5.6. int a = tpc.TestInnerClass.i; should be written int a = TestParentClass.TestInnerClass.i; Some 1.3 compilers were too permissive. Most 1.4 compilers are doing the proper thing. Eclipse is enforcing the spec here.