Exam Review
Java 2 By Example: Too Much?
by Rob Ross
3/26/2001 --
|
|
|
Title |
|
|
|
Java 2 By Example |
|
Authors |
|
|
|
Geoff Friesen |
|
Publisher |
|
|
|
Que |
|
Publication Date |
|
|
|
January 2000 |
|
ISBN |
|
|
|
0-7897-2266-6 |
|
Price |
|
|
|
$24.99 (U.S) |
|
Pros |
|
|
|
Lots of example code to play with. |
|
Cons |
|
|
|
Superfluous detail can confuse the beginner, but not enough for the expert. |
|
Verdict |
|
|
|
I'd have a hard time recommending this as your first Java book. But if you're somewhat familiar with the Java language and syntax, you might appreciate the thorough coverage of these concepts and the example programs. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Learning Java as your first programming language is hard. There are so many concepts that must be assumed before you can even write a "hello world" program.
"Java 2 by Example" by Geoff Friesen (published by Que) doesn't really make it any easier. The true Java novice may be overwhelmed by the exhaustively complete discussion of the language syntax, especially in the first third of the book. However, if you're an intermediate Java developer you might learn some new concepts to help round out your current Java skills. If you like to read technical books and continually hone your Java skills with new experiences, this book may be worth a look.
The book is organized into three general sections: an overview of Java syntax, a survey of various classes from the AWT and JFC libraries, and a "Case Study." At the end of each chapter is a short discussion of a simple example application that you can download from the publisher's Web site. (The URL in the book was invalid, however, and I had to do some hunting on the Que/Macmillan Web site to find it.)
One thing that bothered me about this book was the type convention used to describe program syntax. In other Java texts, this is usually comprised of boldface or italic typeface for certain elements, or different fonts to set off descriptions from program code. But the type conventions used in this book are rather confusing. Everything seems to be in italics and surrounded with superfluous quotes. For example, the definition of an array variable declaration with explicit initialization is given as:
data_type identifier'[' ']' '=' '{' expression ',' … ',' expression '}' ';'
And the definition of a two-dimensional array allocation and default element initialization is:
identifier '=' "new" data_type '[' expression ']' '[' ']' ';'
Now maybe I'm just being picky, but this type convention had me going cross-eyed several times.
A more substantial issue is that the author describes each new concept in excruciating detail, often referencing related concepts that haven't been introduced yet. An example of this over-specificity happens when Fields (class variables) are introduced. Not only do we find out they represent internal storage, but we also learn about all the possible variations, including the more esoteric "transient" and "volatile" keywords, as well as object serialization. I think it would be easy for a Java novice to become very confused with the new concepts being introduced all at once. The author does include forward page references whenever some new external concept is suddenly thrust into the current discussion, so that you can look ahead if you're really curious or just totally lost.
On a more positive note, this book has some excellent coverage of several important topics, including exception handling, packages, string handling and a wonderful overview of data structures in Java. The three chapters on graphical components (for creating window-based applications) are a good starting point, but for serious GUI development, you'll have to consult a book which covers AWT or JFC in detail.
The final chapter is a high-level overview of the software development process, followed by the grand finale of the book: a simple contact manager application. This case study includes most of the topics of the book in one program. It lets you enter people names and phone numbers using a GUI window and other AWT components, and illustrates saving data to a file, responding to button events, and adding, modifying and deleting records from your contact database. The last chapter doesn't discuss the application at all, but there are copious comments that help you understand what's going on with the code. It's a useful learning tool.
Personally, I like reading anything, even if I'm familiar with the material, just to keep sharp. But this is a book I would have passed on at the bookstore. Now that I've read it, I'll put it on my shelf and probably never open it again. There are probably hundreds of Java books out now, most average, some really bad, and a few are really good. I'd put this one in the "fair" column. It's not particularly bad, but it is too detailed in many sections for a beginner, and too sparse for someone with a lot of experience. I'd have a hard time recommending this as your first Java book. But if you're somewhat familiar with the Java language and syntax, you might appreciate the thorough coverage of these concepts and the example programs. Happy Programming!
Rob Ross is currently an independent consultant involved in developing Digital Media Asset applications in Java for the entertainment industry.
|