I suppose this has been dealt with (many?) times in this forum, and if so please refer me to the relevant FAQ, etc., where I can see the answer. But while reading an O'Reilly book I came upon a Java program where the following import statements were made:
Why bother having the second import statement when the first statement, from what I understand, will include EVERYTHING in java.awt.*; ?? Isn't it redundant to use import java.awt.event.*; when just import java.awt.*; will suffice?
If only all questions were as easy to test as this one :-)
Joined: Apr 08, 2013
Thanks for the answers, I figured it was something simple.
The O'Reilly book mentioned the nuances of importing packages, subpackages, etc., but I couldn't for the life of me find the explanation later, weeks after I'd read it. After spending an hour combing through the book I got frustrated, googled for an answer, and read barely legible posts on programming websites that seemed to have my question in mind. I got so frustrated that I decided to check out this site.