File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "import" Watch "import" New topic
Author

import

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
Greenhorn

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.

Ex:

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: 14338
    
  22

More info: Static Import


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import