A new feature introduced in Java5.0 called Static import which allow developers to import static members of a class. In order to access static members, it is necessary to qualify references with the class they came from.
System.out.println("Hello") Or Java.lang.Math.PI;
We can write a program in more readable way by using static import. A static import declaration has two forms:
1. One that imports a particular static member.
Syntax: import static packageName.ClassName.staticMemberName;
eg:
import static java.lang.Math.PI; import static java.lang.System.out;
2. One that imports all static members of a class
Syntax: import static packageName.ClassName.*;
eg:
import static java.lang.Math.*; import static java.lang.System.*;