January 2012 archive

Java Essential Tips: Static Import

Static Import Static import is a mechanism to include constants into your code without referring its class in which the constants defined. For example, if you are using Integer.MAX_VALUE or some other constants field of class java.lang.Integer then you could simply use the following static import statement: [java]import static java.lang.Integer.*; class Demo{ public static void …

Continue reading

Permanent link to this article: https://blog.openshell.in/2012/01/java-essential-tips-static-import/