Master Java with these introductory books

Do these newly released books for Java beginners live up to their predecessors?

Introductory Java books are a rather popular bunch. If you’re interested in Java programming, you have to start somewhere. Most people pick up at least one book to get them started. More popular ones are those that have been around since the beginning of Java time — close to six years now. Core Java (Prentice Hall, 2001) is one of those books and is already up to its fifth edition. Does anyone else remember when this book was only one volume and 622 pages? It’s now spread over two volumes with more than 1,700 pages. While I don’t mean those earlier books aren’t any good (I’m working on the fourth edition of my own Mastering Java 2), sometimes a book’s first edition is its best version, as the author isn’t trying to jam new content into an old structure.

In this article, I’ll review six introductory texts for Java. All of these books are first editions, not rewrites, and have all been released within the last year. I’ll reveal if any of these books stand up to the older set of updated, introductory Java texts.

In alphabetical order, the six books reviewed here are:

  • Beginning Java Objects, Jacquie Barker (Wrox, November 2000)
  • Essentials of the Java Programming Language, Monica Pawlan (Addison-Wesley, May 2000)
  • Java 2: A Beginner’s Guide, Herbert Schildt (Osborne, December 2000)
  • Java 2 Weekend Crash Course, Julio Sanchez and Maria Canton (Hungry Minds, December 2000)
  • Java: Your Visual Blueprint for Building Portable Java Programs, Dr. Ernest Friedmann-Hill (Hungry Minds, February 2001)
  • Professional Java Programming, Brett Spell (Wrox, December 2000)

Table 1 below provides a quick review of the main characteristics of the six books:

Table 1: Introductory Books Overview
  Beginning Java Objects Essentials of the JPL Java 2: A Beginner’s Guide Java 2 Weekend Crash Course Java: Visual Blueprint Professional Java Programming
Price 9.99 4.95 9.99 9.99 6.99 9.99
Total Pages 660 300 570 430 300 1,100

CD-ROM /

Source Code on Web

No / Yes No / Yes No / Yes Yes / No Yes / No No / Yes
Java Version 1.3 1.2 1.3 1.2* 1.3 1.3
OO Basics Excellent Average Good Average Poor Poor
Language Basics Poor Poor Excellent Good Good Poor
Client Side Good Good Poor Average Average Excellent
I/O Average Average Average Good Average Average
Threads None Poor Average None Average Good
Networking None Average None None Average Average
Server Side None Good None None None Average
Level Objects Beginner Beginning – Advanced Beginning Beginning Beginning Intermediate – Advanced*

Scale: None, Poor, Average, Good, Excellent

A star (*) in a field means the review of the specific book provides further details of the ranking.

For the most part, the above table is self-explanatory. After “Java Version,” the rows describe the level of coverage, if any, each book offers on that topic. “Client Side” includes the coverage level for such topics as applets, AWT, Java 2D, and Swing. “Server Side” includes coverage of JDBC, servlets, JavaServer Pages (JSP), RMI, and the rest of the Java 2 Enterprise Edition (J2EE). The final row describes the appropriate reader level.

A more detailed review of the individual books follows, including a comparison to the older beginner books. Is it time you stray from the classics and try something new? Read on and find out. Beside each book’s title is a star rating, which is based on my review of the book’s quality, level of topic coverage, and appropriateness for its target audience. One star is equivalent to a poor rating, and the highest rating (five stars) translates to exceptional coverage.

Beginning Java Objects

Jacquie Barker’s Beginning Java Objects takes an objects-first approach at teaching Java programming. You’ll learn how to do object modeling and how to translate that model into well-designed Java code. With a student-registration-system design serving as the backbone, the text works well as the lesson plan for an object-oriented methodology class.

If you are new to Java programming, Beginning Java Objects offers a taste of Java in the first chapter, and provides more depth 12 chapters later. For most readers, the taste is sufficient to get them started with Java and get them through the code used in the early chapters, which deals with modeling the system. Combining these two chapters (one and thirteen) is all the programming language explanation found in most introductory Java texts. Beyond the language, the only libraries covered in any depth are I/O and Swing. One surprise with the Java code was the book’s use of Hashtable and Vector instead of the newer Java Collections Framework classes.

This book shines mostly in its coverage of object-oriented programming, which typically takes up only one chapter in an introductory text. You’ll learn all about object modeling (even though Barker can’t decide between one l or two in modeling). From use cases and object diagrams to sequence diagrams and collaboration diagrams, you’ll have a good grasp on the basics of Unified Modeling Language (UML) design by the time you are through reading Beginning Java Objects.

Essentials of the Java Programming Language

Essentials of the Java Programming Language by Monica Pawlan may already be familiar to you. It has been available online on Sun’s Java Developer Connection for close to two years now. Consider the printed version a polished edition of the online offering. This tutorial takes you through the process of creating a general-purpose e-commerce system.

Its tutorial-based approach starts out with basic explanations of creating some simple Java programs. You get step-by-step instructions for creating an application, applet, and servlet. The explanations are interspersed with descriptions of such Java basics as classes, methods, and packages. Soon afterwards, topics jump into JDBC, RMI, socket communications, and internationalization, before concluding with an introduction to object-oriented programming (OOP) and an appendix on cryptography with Sun’s Java Cryptography Extension (JCE).

While the last chapter on OOP seems a little out of place, with such varied lesson levels, the book’s target audience seems unclear. Going from extreme hand-holding in the initial lessons, through the use of Oracle OCI 7.3.4 to setup the JDBC chapter, and onto creating a complex RMI system, I can’t tell if Pawlan is targeting someone new to Java or an experienced veteran who needs help creating a working distributed system. As the cover states, the application “illustrates many of the Java 2 platform’s most important elements,” which seem to be the qualifying justification for including every concept in the book. Unfortunately, there isn’t sufficient explanation on such topics as JDBC to create your own programs with the API after reading the book.

The text itself is well written and the created system demonstrates some good concepts on such topics as internationalization and RMI. The book would probably work out well for someone interested in learning about some server-side Java concepts with little explanation beyond the hands-on tutorial.

Java 2: A Beginner’s Guide

Java 2: A Beginner’s Guide by Herbert Schildt provides a goal-based approach to teaching the necessary skills to getting started with Java. Providing a language-first approach at teaching Java, Schildt explores the fundamentals of the language before delving into classes, objects, and inheritance. Full of many different learning aides, the beginning Java programmer should pick up Java quickly and get a feel for how well they are doing with provided self-assessment checks.

Broken into 12 modules, Java 2: A Beginner’s Guide‘s self-paced approach describes the core Java concepts, like the language fundamentals and object basics, quite well. With each concept are short one-minute drills with plenty of annotated code examples. There are also short projects interspersed throughout, with step-by-step walkthroughs that take you through creating a solution. Projects range from the simple to the complex, from demonstrating finalization to creating a disk-based help system. Schildt’s approach works quite well, especially for the new Java programmer who needs a step-by-step guide.

Beyond the language and object fundamentals, the guide starts to look at some of the standard Java libraries. This is limited to the final three chapters. The libraries covered are I/O, multithreading, and applets. The I/O chapter has you work with byte and character-based I/O, while the multithreaded programming chapter has you create multiple threads, deal with synchronization, and send messages between threads. It even has a short write-up on suspending threads without using the language’s deprecated features. The applets chapter is somewhat of a catchall chapter. Besides describing the applet architecture, it explains event handling and some new keywords like volatile and strictfp. Anything dealing with AWT or Swing components as well as drawing with Java is noticeably absent.

Finally, Java 2: A Beginner’s Guide ends with two appendices. The first includes answers for the end of module questions, while the second describes Java’s documentation comments syntax. The book’s questions and answers should help readers get accustomed to testing for certification (though without multiple-choice answers), while the javadoc appendix provides a reasonable level of coverage of the javadoc tags, including the newer serialData and serialField tags.

Java 2 Weekend Crash Course

The premise for Java 2 Weekend Crash Course by Sanchez and Canton is that, given 15 hours of your time, you’ll go from absolutely no Java programming experience on Friday to being able to fill that new Java position on Monday morning, or at least be able to sound reasonably competent for the job interview. The 15 hours of learning spreads across 30 lessons. You will need some programming background before tackling the lessons, as it isn’t meant as a first book on programming. The lessons run the gamut from programming fundamentals and objects, through data structures, I/O, and graphics.

The 30 lessons are broken down into six parts. The first part describes loading and installing the JDK. I mention this primarily because it is the only book reviewed here that actually walks you through the process of downloading, unpacking, and setting your PATH and CLASSPATH. Given the book’s target audience, these are welcome lessons. One oddity though is that the book says that Java 1.3 is the latest version, yet it has you install the Java 1.2.2 JDK. With a December 2000 release date, Sanchez and Canton should have had sufficient time to update the content to Java 1.3.

In the book’s second part, the authors explore the language basics, before jumping into objects and recursion in Part 3. They do a good job of explaining both topics, with more emphasis on learning the language over learning about objects. Interspersed throughout are end-of-session quizzes with end-of-part reviews. The reviews have answers in an appendix but the quizzes only have pointers to answers in earlier sections. Lots of graphics are used to explain the basics, including flow charts — something I haven’t seen in some time.

Sanchez and Canton introduce Java libraries in Parts 4, 5, and 6. I was very disappointed with Part 4’s data structure coverage. Instead of introducing the Java Collections Framework, Sanchez and Canton have you define your own linked list, stack, queue, and tree classes. While I might see a reason for this in a data structures book, you still need to learn about the ever-present libraries to become productive with Java. The I/O coverage is spread across multiple parts, initially exploring console input, and primarily dealing with character input. It even covers file operations and parsing data into tokens. The client-side programming coverage is a little mixed up: you’ll learn about components, painting, fonts, and images, but not about event handling to do anything with the components.

Throughout Java 2 Weekend Crash Course, Sanchez and Canton describe their selected topics at a level appropriate for the intended beginner audience. It reads quite well. Personally, I would have hoped for some coverage of collections and event handling, as previously mentioned, but also coverage of multithreading, which is hard to live without in the Java world.

Java: Your Visual Blueprint for Building Portable Java Programs

The first thing you’ll notice about Java: Your Visual Blueprint for Building Portable Java Programs is its decidedly different presentation method. Instead of the typical large blocks of text to explain concepts interspersed with code examples and figures, the book is primarily broken down into two page spreads designed to explain concepts visually. Across the bottom of the two pages, you get visual pointers for key topics with callouts from the figures (usually screen shots) walking you through the important steps. The top left of the page has a brief paragraph describing the topic, than on the top right you’ll find either code fragments or interesting tips to help you learn a little more about the specific topic. The presentation definitely encourages you to follow the screen dumps with their boxed-off areas and numbered steps. If you like to learn things visually, you’ll really appreciate Dr. Friedman-Hill’s approach.

While the book’s presentation is definitely different, the question that remains is does it do a good job at explaining Java? Technically, the concepts are explained well. Although each concept is explained in approximately 200 words, the accompanying visuals are helpful in reinforcing the concepts. One point worth noting, the two-page presentation methodology occasionally results in consecutive concepts being disconnected and a lack of natural reading flow.

The book itself is broken down into 14 chapters to explain the core Java basics. You’ll learn about some language fundamentals, GUI programming, multithreading, and I/O basics. There’s even a bit on reflection and serialization, which was nice but may be a little advanced for its target audience. After making your way through, you should be able to quite easily create graphical and non-graphical multithreaded programs and do some I/O. You can then graduate onto a more advanced book like the book I’ll review next.

Professional Java Programming

Brett Spell’s Professional Java Programming works well for Java beginners who feel they can pick up the language details as they go along and want a library-first approach at learning Java. As the Java libraries are so rich, some people prefer to learn about them first in order to avoid reinventing the wheel as they become familiar with the language. For most people though, Professional Java Programming serves as a better follow-up to the other books reviewed here. It’s subtitle really gives you a strong feel for its focal points: Class Design, Threads, Event Handling, Layout Managers, Swing Components, JDBC, XML, Security, JavaHelp, JNI, Performance, and Distributed Objects. Spell even threw in an internationalization chapter that the cover doesn’t mention.

The book starts off with Java basics and class design. Instead of covering language basics, Spell discusses such topics as the runtime constant pool and garbage collection. Instead of covering inheritance and object basics, he covers the reasons behind loose coupling and strong cohesion, among other topics. The first two chapters give you a good feel for how the rest of the book will come across: well-written, concise text, lots of code, and the occasional UML diagram (class, collaboration, and sequencing, to name a few).

The rest of the book delves into several of the standard Java libraries. You’ll notice a strong emphasis on client-side programming over server-side programming. After a chapter on multithreaded programming, the next eight chapters cover Java Foundation Classes (JFC) concepts, from event handling and layout managers, to components with an emphasis on trees and tables, through drag-and-drop and printing. After making your way through the more than 400 pages on GUI programming, you’ll welcome the change to server-side concepts like JDBC — including 2.0 capabilities like row sets; on to XML with an exploration of JAXP, SAX, DOM, and XSL; as well as distributed objects — with sockets, CORBA, and RMI. This leaves a handful of more general concepts to explore: the I/O coverage is primarily focused on serialization, but also describes storing object instances in a relational database. Spell goes over the JavaHelp and JNI APIs too, as well as performance tuning and internationalizing your application. The security content is surprisingly limited to code signing and exploring the permission types.

All in all, the book provides a nice broad look into the author’s choice of standard and extension libraries. It seems the coverage chosen tries to fill in the gaps in the Wrox lineup between Beginning Java 2 and the Professional Java Server Programming.

Is it time for a change?

Everybody learns differently and it’s hard to pick a single best book for all. Books like Core Java, Java in a Nutshell, Thinking in Java, The Java Tutorial, Mastering Java 2, and others have been around for some time and continue to serve their purpose well. Java 2: A Beginner’s Guide has the best shot at joining these books as a first choice for learning Java, doing a great job for the beginning Java programmer.

For the right person, I’d recommend Java: Your Visual Blueprint for Building Portable Java Programs and Java 2 Weekend Crash Course. The former is great for someone looking to learn Java by using both halves of their brain, while the second is a quick, inexpensive way to pick up Java basics. Java in a Nutshell, once at less than 0, is now pushing 0 and is more of a reference than a tutorial. Professional Java Programming is also good, but falls more in the realm of Core Java, Volume 2, as a second book, then something to get you started. At 0, Professional Java Programming is also the most expensive of the bunch, including the older books. For almost everyone, I can recommend Beginning Java Objects as a primer to object modeling. Although the book’s author and many readers may disagree with me, I can’t recommend Beginning Java Objects as a first book to learn the Java programming language. But once you grasp the basics of the language, if you need to learn how to properly design a system, this book is a great help. This book works well even for someone very familiar with Java programming but lacking skills in the object-modeling world.

If you have absolutely no background in programming though, I’d be more inclined to pick up one designed for a first-semester, computer science student, like K.N. King’s Java Programming: From the Beginning (Norton, 2000).

John Zukowski is a strategic Java consultant
with his company JZ Ventures Inc., lectures on Web technologies for
Boston-based Northeastern University, and writes books on Java. His
latest books are Java
Collections and the Definitive
Guide to Swing for Java 2, Second Edition from Apress.

Source: www.infoworld.com