Community
Participate
Working Groups
An example package a; class B { } --------------- package a; class C { public static void foo(){} } -------------- import a; B a; a.C.foo();//gives compile error --------------
compiler is rigth, as far as i know the spec: section 6.3.2 http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#104058 "A simple name may occur in contexts where it may potentially be interpreted as the name of a variable, a type or a package. In these situations, the rules of ยง6.5 specify that a variable will be chosen in preference to a type, and that a type will be chosen in preference to a package. Thus, it is may sometimes be impossible to refer to a visible type or package declaration via its simple name. We say that such a declaration is obscured."
This is indeed expected behavior.