Found an Error in On To Java?

We are eager to hear about any bugs that you may have found in our book. Please peruse the list below, to see if we already know about the error. If you do not find the bug you have discovered in this list, please send us email at phw@ai.mit.edu.

Click here to do so now.


Currently Known Bugs in On To Java, Third Edition

No known bugs at this time.

Currently Known Bugs in On To Java, Second Edition

Last updated: June 1, 1997


No known bugs at this time.

Note that if your web browser is not 1.2 compliant, you must use Java's appletviewer to test your programs.


Known Bugs in On To Java, First Edition

Last updated: January 1, 1996


Bugs Corrected in the Third Printing

A few bugs survived to the third printing. Among those bugs, the only ones that could cause serious confusion are those in segments 765 and 822 in which Observable appears in the book, rather than Observer.
Page ix
Books         319 <-- Bug
Index         319 <-- Fix


Page 17, Segment 68

computation of volume   <-- Bug
computation             <-- Fix


Page 26, Segment 103
return s * a * d; <-- Bug
return s + a + d; <-- Fix


Page 30, Segment 122
displayMovieRating(doubleScript, intActing, doubleDirecting)    <-- Bug
displayMovieRating(doubleScript, doubleActing, doubleDirecting) <-- Fix


Page 37, Segment 143
Oops.  Class variables are not intruduced until Section 8.


Page 41, Segment 156
First, you declare the local variables ... <-- Bug
                       ~~~~~
First, you declare the class variables ... <-- Fix
                       ~~~~~


Page 140, Segment 460
now  --> Now"
~  ~     ~  ~


Page 164 and page 165, Segments 520 and 522
deleteElementAt --> removeElementAt


Page 182, Segment 577
output.close();     <-- Bug
outputFile.close(); <-- Fix


Page 183, Segment 579
file variable        <-- Bug
file stream variable <-- Fix


Page 191, Segment 595
member variable --> instance variable


Page 198, Segment 612
int n = rating() / 3; <-- Delete, not used


Page 221, Segment 678
In the first paragraph, y should be 50, not 100, and
g.drawString(title, 100, 0);  <-- Bug
g.drawString(title, 100, 50); <-- Fix
in two places.


Page 222, Segment 679
int height = f.getHeight();   <-- Delete, not used
int descent = f.getDescent(); <-- Delete, not used


Page 223, Segment 681
Same as Page 222, Segment 679.


Page 255, Segment 765
class ImagePanel extends Panel implements Observable{ <-- Bug
                                          ~~~~~~~~~~
class ImagePanel extends Panel implements Observer{   <-- Fix
                                          ~~~~~~~~

Page 276, Segment 822
Same as Page 255, Segment 765


Page 297, Segment 881
To be consistent with Page 300, Segment 893
resize(600, 300); --> resize(600, 275);
            ~~~                   ~~~


Page 309, Segment 900
/APPLET tag missing after APPLET tag


Page 313, Segment 910
To be consistent with Page 311, Segment 906, and to eliminate
a redundant change of color, make the following changes:
  g.setColor(Color.black); <--*
  if (cosAngle <= 0) {        | Move setColor statement
                            --*
   g.fillOval(x0 + dX - sR, y0 + dY - sR, sD, sD);
  }
  g.setColor(Color.gray);
  g.fillOval(x0 - pR, y0 - pR, pD, pD);
  g.setColor(Color.black);
  if (cosAngle > 0) {
                            <-- Delete setColor statement
   g.fillOval(x0 + dX - sR, y0 + dY - sR, sD, sD);


Bugs Corrected in the Second Printing

In producing our book, PostScript files are printed as negatives on film, which then are used to produce the copper plates which are used in the printing press. Incredibly, when our files were sent to the film producer, one of their programs failed to clear a character table between the 10-to-50-page text chunks into which the book was divided. Consequently, characters that appear in the second and subsequent text chunks of a run, but not in the first chunk, dropped out. Why their software did not sound an alarm is beyond us. In particular, we know about the following examples, there may be others.
Pages 64--77

C (boxCar became box ar)

Z (Zero became  ero)

H (getHours and setHours became get ours and get ours)


Pages 163--171

V (Vector became  ector)

j (Object became Ob ect)

L (Long became  ong)

' ('M', 'S', and '"' became  M ,  S , and  ")