Award-winning Top 25 JUG!

Book Reviews

This book review was submitted by a DenverJUG member as part of the Book Review Program.

BOOK DETAILS

Java Cookbook, 2nd Edition
Author: Ian Darwin
Publisher: O'Reilly
Publish Date: June, 2004
Pages: 862
ISBN: 0-596-00701-9
Publisher's Book Description

Review Date: October, 2004
 

REVIEWER

Steve Nicodemus

REVIEW

Java Cookbook is mainly intended as a reference book, but it could also be used as a tutorial. Probably, it was mainly intended to be a book for someone who wants to review or learn about some specific aspect of Java (or programming in general). There are 26 chapters, and each chapter is divided into several topics. For each topic, there is some code given as an example. For example, if someone wants to remember how to write to a binary file, they could go to section 10.15, and there is a short program that does just that. The topics are listed in the table of contents. As mentioned, the book could also be used as a tutorial if the reader already has some familiarity with Java. On the other hand, there are no exercises.

This book would be useful to programmers at any level except for an absolute beginner. Some familiarity with the Java language is assumed. Such topics as variables, assignments, expressions, selection statements, loops, classes, and methods are not covered at an elementary level. If the reader goes through the book in order, it would also be useful to have some understanding of arrays, AWT/Swing, and basic file I/O. Strings are explained early in the book. The reader should look through Chapter 1 first, since it explains the packages in "com.darwinsys" used in many of the sample programs throughout the book. (They are in the darwinsys.jar file which is included in the code sample download.)

There are two web sites associated with this book: O'Reilly's Catalog and the author's website. The sample code can be downloaded from the latter site. Many of the examples are only listed as fragments in the book, but in the download they are complete programs. The author is constantly changing the code in the download, so some of the examples are different than they are in the book. I found two cases where bugs had been introduced with the modifications, but fortunately they were easy to correct. There was one program mentioned in chapter 13 called CompTest which was not included either in the book or the download. It was needed to run most of the programs in that chapter, so I tried to write it myself. Unfortunately, it required some concepts which had not yet been covered.

This second edition of the book covers Java 1.5. This version is required for some of the examples, but most can be run with an earlier version. It is not geared for any particular platform, but the Macintosh seemed to be the author's favorite, and some UNIX shell scripts were included along with the code.

There are a good many topics that are covered both from Java and programming in general. A few of the topics are only touched on, and another book would be needed to learn these. Some, such as Ant and jdb, are only covered enough to arouse the reader's curiosity. There is a chapter on regular expressions, but it is more about how to use them in Java than how to construct them.

Overall, this is an excellent book, particularly for someone that knows Java well but needs to go over some specifics they never learned or have forgotten.