File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes imports 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 » Performance
Bookmark "imports" Watch "imports" New topic


Arvind Chavar
Ranch Hand

Joined: May 16, 2001
Posts: 53
Does wildcard imports of packages place any performance penalties as compared to only importing required classes?
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
I don't believe so. They are all aliases.

By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
Dale is correct.
import statements have no affect what so ever on performance.
u can put as many as u want including as many wildcards as u want and it wont affect it one bit.
import staments only help us typing out the name of the class instead of the FULL name inlcuding the package.
however, u should note that using wildcards is not recommended for a diffrent reason: it may cause class name clashes in your pgram and make it sometimes harder to understand.
Arvind Chavar
Ranch Hand

Joined: May 16, 2001
Posts: 53
Dale and Roy ,Thanks!!
I agree. Here's the link:
subject: imports
It's not a secret anymore!