If you are writing something not application specific in Java you are doing something wrong as it is probably already written for you. But finding the correct solution or class that answers the need you have is often hard. Books such as Java in a Nutshell are useful, but you need to know what you want before you look.
Ian Darwin’s book Java Cookbook is a mammoth (829 page) book that provides answers to hundreds of questions. His style is easy to follow. The book is broken down into major topic areas (strings, numbers, OO techniques, networking, etc.). Each section begins with an overview of the capabilities that Java provides in that area followed by a series of Q&A entries that address specific problems a programmer might encounter. He then concludes with a simple application (or two) that demonstrates the techniques he has discussed. Simple, straightforward, useful.
This second edition has expanded to cover new features that are being developed for Java 1.5. As a programmer familiar with working in Java (but by no means an expert) I found these topics to be the most enlightening. Specifically the coverage of the new foreach
construct and the templating mechanisms.
Overall this is a book useful for everyone who codes in Java. It has basic techniques for the new user, and expands into areas that an expert would need.