There's no difference in performance. The import statement doesn't
actually import anything - in the sense of adding any .class files - its
purpose is to help the compiler resolve the names of types.
Many people prefer to import classes individually (or have some IDE
do it for them!) because this allows you to see at a glance what
classes you are using, and there is less chance of names conflicting.
> Is there any difference in performance between
> importing all the package and importing only the
> needed classes. I am doing an applet project and as
> it first must download the classes I wonder if it may
> be faster to import just the needed classes instead
> of all of the package.
Importing has zero effect at runtime. It does NOT cause any classes to be "downloaded" or loaded or anything like that. If you import everything.* or specific classes or nothing at all, the generated byte code will be identical, and the VM will do exactly the same thing.
Importing only matters at compile time. It just lets you use, for example, List instead of java.util.List, and the compiler then figures out what you mean by List.
Having said that, it's generally considered better form to import specific classes. This makes it easier for somebody reading your code later (including you) to see which classes came from where.