| Author |
imports statement.
|
ManavChowdary Chalasani
Greenhorn
Joined: Dec 19, 2003
Posts: 2
|
|
|
what is the difference between import package.* and import package.class in java? Performance wise? I know the basic difference , like using "*" imports all the classes and using the "package.class" only a particular class in the package. I want more in detail.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24040
|
|
Here is the [url=http://"http://faq.javaranch.com/view?WildCardVsSpecificImports"]JavaRanch FAQ entry on this topic.[/url] This question is asked very often. Short answer: performance-wise, there's no detectable difference whatsoever, either at runtime or compile time. Which you use is a matter of taste; most experienced practitioners recommend the individual class imports.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Srinivas Kalvala
Ranch Hand
Joined: Oct 20, 2005
Posts: 257
|
|
Hello, The individual import statements increases the readability of the program and it will be very clear which classes have been used. In terms of performance there is no significance difference and more over .* will not include all classes, but will search for whole package to find the correct class to load.
|
 |
 |
|
|
subject: imports statement.
|
|
|