android - Why is static Used in Importing Libraries -
this question has answer here:
- static import in java [closed] 5 answers
static import feature introduced in java 5 programming language allows members (fields , methods) defined in class public static used in java code; without specifying class in field defined.
the static import feature facilitate java programmer access static member of class directly. there no need qualify class name.
sample example
import static java.lang.system.*; class staticimportexample{ public static void main(string args[]){ out.println("hello");//now no need of system.out out.println("java"); } }
Comments
Post a Comment