posted 16 years ago
Source: Whizlabs, but a bit modified for study
I have two files: test.java in package InnerClass and another file called test1.java.
Code for both is this:
If Line 2 in test1.java is commented, I get the error "cannot find symbol x".
I understand that we have to do a static import of x because x is declared static in test.java.
But my doubt is: Even the class Utilities is static in test.java. How come I am able to compile test1.java only with import InnerClass.test.*; ?
I mean, without doing a STATIC import of the static CLASS, I am able to use it. But, the same does not apply to the static VARIABLE x...Any differences?