by Cay S. Horstmann and Gary Cornell
Publisher: Prentice Hall
Publication Date: September 2007
Reviewed by Dana Nourie
"Since 1995, Sun Microsystems has released seven major revisions of the Java Development Kit... The Application Programming Interface (API) has grown from about 200 to over 3,000 classes," according to Core Java: Volume I, Fundamentals by Cay S. Horstmann and Gary Cornell. As you can imagine, this book has grown from the first edition of 672 pages to this eighth edition of 864 pages. This edition focuses on Java Platform, Standard Edition 6 (Java SE 6).
These authors know the platform well and have structured the book in such a way that it's easy to find exactly the information or code samples you seek. The authors explain on the first page, "We still target serious programmers who want to put Java to work on real projects." They assume that readers of this book have a solid background in programming in another language, and they assume that you don't like toy or silly examples. Instead, the book is filled with examples that demonstrate almost every library and language feature.
The book begins as you might expect, explaining a bit about the Java platform and how to download and install the JDK. It also provides examples so that you can be sure that you're up and running on your computer. By page 35, you get to the meat: programming structures and syntax.
Once you have the structures down, the book provides nice detail on object-oriented programming itself, vital to understanding this platform, then helps you expand your knowledge by detailing inheritance, interfaces, and inner classes. Next, the authors discuss the big topic of graphics programming and event handling, with plenty of sample code. Using user interface components with Swing takes up a good portion of the book, as you might expect. All of this will get you far in creating applications written in the Java programming language.
Of course, once you have these basics and have written a few applications, you'll need to package and deploy your application or applet so that others can use it. As a staff writer for Java, I frequently hear developers asking how they should package their applications, so I thought that Chapter 10, Deploying Applications and Applets (PDF) would be an excellent chapter to post as a sample for the book.
In this chapter, you learn how to package your application in a single file called a Java Archive (JAR) file and how to deal with resources. Next, you get a description of Java Web Start technology and learn to set it up to launch your application. In addition, you will learn how to use applets. Lastly, this chapter details how to store your application preferences.
The chapters are consistently formatted, so a look at Chapter 10 will give you a good idea of the authors' writing style. It will also help you see the kind of sample code that the book provides, as well as the level of programming acumen you need.
After Chapter 10, the authors discuss slightly more advanced topics such as exception handling, generic programming, collections, and multithreading. For topics such as files and streams, distributed objects, database, native methods, XML processing, and so forth, you'll have to wait for Core Java, Volume II.
This book strikes just the right balance of explanation of classes and features with sample code. Some authors explain concepts in such detail that they leave the reader confused or exhausted. But Horstmann and Cornell provide explanations that get to the point -- and no more. The code samples are excellent, with helpful comments throughout. The authors also provide the sample code online so you don't have to retype everything -- though if you're just learning, typing out the code is good practice.
This book is an excellent resource for learning, as well as a great reference book. With the many code samples and short explanations, Core Java: Volume I, Fundamentals is a book that you will often pull from the bookshelf to get quick information and syntax reminders.
Sun Microsystems Press Bookstore Sample Chapter