permaculture playing cards*
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 Android Security Essentials Live Lessons this week in the Android 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!!
It is sorta covered in the JavaRanch Style Guide.
subject: imports
Similar Threads
Please help - Need advice
Why these imports in AdviceClient class?
JBuilder and required projects
Implementing scanner into a simple login page