Static Import in Java with an Example
What is Static Import:
Static Import is a feature added in Java 1.5(released in Sep 30 2004 almost 10 years back!) along with Var-args,Auto-Boxing and Auto-Unboxing, Generics, Enhanced for-loop,Enums,Scanner Class and Annotations. Using this Static Import feature we can import static members of a class and as well we can access all non-private static members without using class name from other classes.
Static Import is a feature added in Java 1.5(released in Sep 30 2004 almost 10 years back!) along with Var-args,Auto-Boxing and Auto-Unboxing, Generics, Enhanced for-loop,Enums,Scanner Class and Annotations. Using this Static Import feature we can import static members of a class and as well we can access all non-private static members without using class name from other classes.