I purposefully left the import statements from many of the code snippets in both editions in order to make them a little more concise.
From the intro:
To keep the code samples reasonably concise, I have not always included every import statement required in the code samples within the book. However the downloadable code samples do include all the required import statements. Additionally, if you are developing using Eclipse, you can use the keyboard shortcut Ctrl+Shift+O (Cmd+Shift+O) to insert the required import statements automatically.
You can download the code samples for this new edition
, which are included within full projects, and have all the necessary import statements included within them.
Hopefully that makes them easier to understand and use than in the previous edition.