I have two
java source files as below:
Test2.java
Test.java
My problem is I don't understand why Line 1 does not compile, but Line 2 compiles okay. The static import in Test.java does not import the class Test2 itself, but only the static members of Test2. If that is true, why does Line 2 work - Doesn't the java compiler need Test2 to be visible before it could access its instance member data? If you comment out Line 1, you will see that Test.java compiles and executes.