Cannot `import static` static inner class?
I have a class A with a static inner class inside it called B : import static A.B.*; class A { static class B { static int x; static int y; } public static void main(String[] args) { System.out.println(x); } } I want to static import everything in B , but it wont work: $ javac A.java A.java:1: package A does not exist import static A.B.*; ^ A.java:9: cannot find symbol symbol : variable x location: class A System.out.println(x); ^ 2 errors Why? Reimeus This won't work if A is in the default package. However, you could add a package declaration: package mypackage; and use import static