File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "import" Watch "import" New topic


Arun Prasath
Ranch Hand

Joined: Jul 18, 2006
Posts: 60
can import followed by static keyword be given..?
what is a static import?
gunasekhar arvind

Joined: Sep 05, 2006
Posts: 7
Static imports is a new feature that was added in Java5.This feature basically enables you to import static fields and methods.


import static java.lang.System.out;
import static java.lang.Integer.*;

/* If you use the above static imports then you can use the following */

out.println("Hi");/* Instead of having to say System.out.println("Hi"); */
out.println(MAX_VALUE); /* instead of System.out.println(Integer.MAX_VALUE); */

Cheers!!<br />gunasekhar
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15094

More info: Static Import

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: import
It's not a secret anymore!