Please send errata to liang@armstrong.edu. Thanks for helping improve the book!

The solution to even-numbered exercises has been updated. Please download it from here.

First Printing Errata (September 2002)

Chapter 7

Page 281,  Last line, change s1 to s. (Thanks to Alex Letichevsky of UT Dallas. 1/14/03)

Chapter 8

Page 321, delete the equals method in the Circle class.

Page 322, delete the equals method in the Rectangle class.

Page 323,  (1) delete the equals method in the Cylinder class.

                   (2)  delete the first sentence after the source code, "The data field radius is protected, so it can be referenced by any subclass of Circle." (Thanks to Bill Horst of Sun Microsystems for the correction. 10/20/02)

                   (3)  change the second sentence after the source code, "The methods equals and toString are" to "The toString method is". (Thanks to Bill Horst of Sun Microsystems for the correction. 10/20/02)

Page 339, add the following equals method in the CloneableCircle class:

  /** Override the equals() method defined in the Object class */

  public boolean equals(Object circle) {

    return this.getRadius() == ((Circle)circle).getRadius();

  }

 

Page 324, Add the following NOTE before Section 8.8.

NOTE: You can jump to Chapter 10 and read before Section 10.11, "Event-Driven Programming," and then resume Section 8.8.

 

Chapter 9

Page 395, replace Lines 46-50 by the following lines: (Thanks to  Don Costello of U. of Nebraska for the correction. 2/21/03)

 /** Add an element at the specified index.
    * Note: add(element, 0) is same as addFirst(element)
    */
public void add(Object element, int index) {
if (index == 0) addFirst(element);

Click here to download the complete source code for GenericLinkedList.java.

The output in Figure 9.19 should be Daniel John Tom Michelle George Michael Samantha

Chapter 12

Page 598, Last three lines, delete "The fill and anchor parameters are class variables, whereas gridx, gridy, gridwidth, gridheight, weightx, and weighty are instance variables." (10/28/02)