Importing a package recursively (with subpackages)
807580Feb 26 2010 — edited Mar 2 2010Hello everyone,
I'm a 1st-year CS major and am new to Java. I had a question about importing packages. As I understand it, when you use a wildcard when importing, it will import the classes within the package specified before the asterisk, but none of the subpackages in the specified package.
Sort of like in Linux when you have to pass the -R (recursive) argument to list files contained deeper within the directory hierarchy.
My question is, is there a way to include all classes and subpackages with a single line, instead of doing:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
I understand that it doesn't actually cause any bloat in your bytecode, so if it can be done, would there be any disadvantage?
Thanks!