<EM>The Java Programming Language</EM><br> by Ken Arnold and James Gosling
Physicists, paraphrasing Newton, say they stand on the shoulders of giants. Unfortunately, computer scientists all too often stand on each otherโs feet. However, Ken Arnold and James Gosling clearly stood on the shoulders of Brian Kernighan and Dennis Ritchie โ authors of the classic C text The C Programming Language โ as they wrote their Java Programming series, which itself is destined to become a classic in its field.
This first book in a series by the originators of the Java language is the K&R of Java. Not only does it consciously follow the style and organization of The C Programming Language, it is analogous in other ways as well: it provides a definition of a language written by the people who know it best. And it does so without being formal or strictly complete. Java programmers will find it indispensable.
Like their predecessors, Arnold and Gosling start with โHello, world.โ (Beware of the typo in the code on page 1: Line 3 should read System.out.println("Hello, world");.) They then move through classes, objects, controls, threads and types. However, the authors go beyond just defining the Java language. They also explain how to use Java โ and use it well. The book covers good programming and design as well as the limitations of the language.
Each example is shown with good software engineering in mind, and with the particulars detailed clearly. For example, in the following excerpt, the authors explain why local data should be protected from change by outside methods: โMaking fields private and adding methods to set and fetch them enables you to add actions that may be needed in the future. If programmers can access a classโs fields directly, you have no control over what values they will use or what happens when values are changed.โ They then go on to explain Javaโs limitations and implementation in a straightforward fashion, and with a wry sense of humor: โYou can extend the RuntimeException and Error classes yourself to create your own unchecked exceptionsโฆ. The only reason you should know this is so that you can be warned against doing it.โ On the whole, in fact, this book is surprisingly well-written and readable. Many of the examples โ such as this one describing the interface โ are cleverly written:
interface Shimmer extends FloorWax, DessertTopping {
double amazing Price();
}
Even if you donโt get the old โSaturday Night Liveโ reference, the technical point remains clear. And if you do get the joke, the humor may spur you on.
Even more entertaining are the authorsโ insider stories about how key features of the language were worked out. For example, Arnold and Gosling describe some of the potential conflicts inherent in multiple inheritance and how they got around them. The reader is left with a fuller understanding of the language for this additional material.
One caveat: The authorsโ treatment of such a wide range of subjects (from syntax to language design issues) within the Java language makes for a slightly uneven book. And the book wonโt make much sense to you if you donโt know anything about object-oriented programming. Then again, the writers donโt always seem certain of who their readers are. For instance, in a paragraph about comments in the code, they write, โThe English-like things scattered through the code are commentsโ. Thatโs like Einstein writing out the equations for relativity, then saying, โThat little โ2โ in the corner means itโs squared.โ Fortunately, this sort of split personality is infrequent and doesnโt really diminish the usefulness of the book.
At the end, there is a good bibliography covering a variety of resources, from references for multithreading to software and Java Web sites.
Bottom line: Everybodyโs got a book on Java, but this one stands alone as the best of the bunch. And the good news is that there are several more forthcoming.
ENDNOTE: All site logos used with permission from their respective sites. :END_ENDNOTE


