It would not be appropriate to leave a discussion on Java without referring to one of the other seminal books on this subject. This is Java in A Nutshell, By David Flanagan Published by O'Reilly.
O'Reilly Books have a solid reputation for creating both "How to" books, and also solid reference tomes. This book is clearly in the latter category. It is not a book for people who want a light read !
At least half of this book is a printed version of the "Javadocs" which are available online. True, there is a bit of "how to" scattered among the book, but this is sparse. An exception to this is the explanation of java.io package, which very helpfully contextualises the I/O functionality of Java. The Quick Reference itself is prefixed by a very solid explanation of what the different javadoc information means. Nevertheless, it is tempting to ask why I would purchase this book if I could get the information online
Leaving aside the major portion of the book, the first half is dedicated to a systematic review of the main features of Java;
- Basic Java Syntax
- Object-Orientated Programming principles
- Runtime issues, including Networking and I/O
- Implementation of Security
- JavaBeans (not to be confused with Enterprise Java Beans, by the way).
- Programming and Documentation Conventions
- Java Development Tools
Be warned, however. These chapters are clearly meant for experienced programmers of other languages, or Java programmers themselves. They are concise, rigerous, and take no prisoners. The chapter on Object-Orientated Programming, for example, focuses on the primary features of Java which make it an OO language. If you don't already know what OO is about, you will have a struggle with this chapter.
Coincidentally, just after having seen the 3rd Edition, I was able to get a copy of the latest edition, which includes references of Java version 1.4, which is currently the latest J2EE version (version 5 will be on it's way very soon, however). This latest edition has been slightly re-designed in order to incorporate the additional approach which 1.4 introduced
I have used this book alongside the SAMS publication Java 2 Primer Plus by Steven Haines & Stephen Potts, and have found that they complement one another very well. The SAMS book is a tutorial - the O'Reilly is exactly what it says on the cover - a Desktop Quick Reference.