Java 2 by Example is aimed at beginners to intermediate level programmers. Its stated aims are to teach programming in Java by presenting real-world examples. There is a delicate balance between giving a good grounding in the basics of programming, without insulting the reader's intelligence and teaching the more advanced techniques without over-stretching the reader's abilities. This book struggles to get that balance right. It starts with the obligatory 'Hello World' program (although it is a bit more original in that it says 'Welcome to Java'), then all the Java reserved words and operators are explained in a rather slow and pedantic fashion. After describing the structure of a Java program the author skips over some of the more difficult concepts, like object cloning, much too quickly.
Many of the example programs (available for download from Que's web site) are far too trivial in nature but they demonstrate the programming techniques adequately. There are no exercises for the reader to test his or her understanding of each chapter. The programs seem to be free of any major errors, at least.
The chapters are structured reasonably well, each new topic building on what has been taught so far. Geoff Friesen's writing style is fairly easy to follow but some sections need to be read two or three times to fully comprehend the subject matter. Similarly, a lot of new terminology is introduced in each chapter and I think it would have been a good idea if these could have been highlighted in some way, so that you could refer back to those which you had not fully grasped first time.
About a quarter of the book is devoted to the Java Foundation Classes (JFC), which is probably the most interesting section. All of the class methods and components are described with short example programs showing how to create your own GUI programs. The next two chapters deal with multi-threading and streams and once again the example programs are somewhat trivial in style.
The book concludes with developing a more substantial application, a contact manager program.
The whole book is based on the Java Development Kit 1.2 available for free download from Sun's web site. This is run from a DOS window. Sun has now released JDK 1.3 which is a Windows programming environment similar to Borland's JBuilder. Therefore, I feel that this book is already a bit out of date as few people will want to revert back to the Dark Ages of programming under DOS. Most of the example programs are stand-alone to be run from the command prompt. There are few examples of writing Java applets to enhance your web site design.
Overall, Java 2 by Example is quite a good introduction to Java programming but I would recommend prospective buyers to have a look at other Java books in the bookshop to see if they are better suited to your particular needs. If you are using one of the RAD tools like JBuilder or are interested in writing Java applets for your web site then there are probably better books on the market. This is also not suitable to be used as a reference book for Java. If you can afford to buy several books then this could still be a useful addition to your bookshelf.