aspose 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 13869
    
  10

More info: Static Import


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import
 
Similar Threads
static imports
doubt about import static
static import
Static Imports
IMPORTS Doubt