One embodiment of the present invention provides a system that facilitates
importing static members of a class. During operation, the system
examines code associated with a compilation unit to locate a static
import declaration that identifies one or more static members of the
class to import. Upon finding such a static import declaration, the
system records the static import declaration in a symbol table used to
compile the compilation unit. This allows the names for the one or more
static members of the class to appear within the compilation unit without
being prefixed with a name for the class.