Static import is a new feature introduced in j2SE 5.0. It allows the static members of the imported class to be treated as if they were declared in the class that uses them. It is now no longer required to use the static class name and dot operator as was required before. Static imports are of the following two types:
- One in which all the members of a particular static class are imported:
import static packageName.ClassName.*; - And the other in which only a particular member of a class is imported:
import static packageName.ClassName.membername;
Responses to “What are the types of static import?”