This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Package import statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Package import statement" Watch "Package import statement" New topic
Author

Package import statement

alfred neih
Greenhorn

Joined: Feb 18, 2012
Posts: 1
Hi Friends

Could someone throw some light on what happens when you write additional import statements besides those that are being used in a java program ?
Does it slows down stuff or something ?

Thanks
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

No. Import statements are just an indication for the compiler where to look for classes necessary during compilation. After all classes have been found and the program has been compiled, the imports are just discarded.

Welcome to CodeRanch!
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

In other words, imports have precisely zero effect on the generated bytecode, and therefore have zero effect at runtime.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Package import statement