importing packages, why import more than once
I've seen the following in a textbook:
import java.awt.*;
import java.awt.event.*;
// the rest of the code follows
Isn't this redundant?When we use the asterisk after java.awt, doesn't that import all classes inside the awt package, including the event package? Is there something I'm missing / not understanding.
thanks in advance for your help.
[485 byte] By [
frnkwllya] at [2007-10-2 3:29:02]

Thanks Vanilla, your post helps. Can you expound any more? I would have thought the relationship was that "awt" is a package that contains both classes and other packages, and that "event" is a package in the "awt" package.
Why does Java use the dot notation if the packages aren't hierarchical? Why not import java.awt and java.event? Is it for organization purposes (to group similar packages)?
Sorry if my terminology is incorrect, I'm a "self-taught-work-in-progress newbie" if you couldn't tell. That's why I'm trying to understand the concepts.
Thanks!
> Thanks Vanilla, your post helps. Can you expound any
> more? I would have thought the relationship was that
> "awt" is a package that contains both classes and
> other packages, and that "event" is a package in the
> "awt" package.
It would seem that way, but it's not.
> Why does Java use the dot notation if the packages
> aren't hierarchical?
I guess because, even though the packages aren't related as far as Java is concerned, there's a conceptual relationship that we humans use, and the dot notation matches that. Plus the elements of package names correspond to directories, so while the language doesn't care, ClassLoaders do use that aspect of the name to find the class.