ERRATA for Computing with Java: Programs, Object, Graphics Copyright 1998, Art Gittleman This is the first edition. Corrections are divided according to the printing. FIRST PRINTING ONLY (Letter Z on the copyright page.) p. 22 Line 9 of Figure 1.15 Change "Enter" To "Enter p. 22 Line 11 of Figure 1.15 Change "Finish" To "Finish" p. 22 Line 12 of Figure 1.15 Change "Start" To "Start" p. 37 Line 5 from the bottom Change "Figure 2.1" To "Figure 2.2" p. 41 Line 4 from the bottom Change "names." To "names," p. 68 Line 5 from the bottom Change "Puts the main method from" To "Uses the BankAccount class of" p. 111 Line 5 Change "Example 2.6" To "Example 2.9" p. 116 Exercise 2a Change "3/2" To "3.0/2" p. 117 Exercise 4e Change "one" To "none" p. 161 Line 14 from bottom Change "MetricToEnglish" To "MetricToEnglish()" p. 161 Line 11 from bottom Change "EnglishToMetric" To "EnglishToMetric()" p. 164 Line 19 Change "MetricToEnglish" To "MetricToEnglish()" p. 167 Line 14 Change "EnglishToMetric" To "EnglishToMetric()" p. 172 Note 3 Change "day" To "daynum" p. 178 Line 2 from bottom Change "pattern 142657" To "pattern 142857" p. 183 Line 3 from bottom Change "Figures" To "Figure" p. 184 Line 8 Change "5.1" To "5.2" p. 188 Indent line 12 from bottom three spaces as follows: Compare returns the negative number -15 hat rack p. 204 Line 10 from the bottom Change "Strings" To "String s" p. 210 Lines 4 and 5 Change "Name.java, Address.java, and Person.java" To "Name.class, Address.class, and Person.class" p. 216 Lines 21 and 22 Change "BigNumber" To "BigInteger" p. 229 Line 5 Change "SavingAccount" To "SavingsAccount" p. 229 Line 6 Change "savings" To "savings;" p. 230 Exercise 10 Omit "Override the postInterest method to add the interest to fundsAvailable." p. 232 Line 2 Change "Accomodation" To "Accommodation" p. 250 Line 2 Change "Figure 6.4" To "Figure 6.7" p. 267 Line 9 Change "Figure 6.30" To "Figure 6.31" p. 269 Line 8 from the bottom Change "Investor investor" To "RateChangeListener investor" p. 269 Line 7 from the bottom Change "Business business" To "RateChangeListener business" p. 322 Figure 8.3 Change "TestField" To "TextField" p. 322 Figure 8.3 Interchange "Canvas" with "Container" p. 322 Figure 8.3 Change "textComponent" To "TextComponent" p. 336 Figure 8.12 Remove the dark circle from the circle on the right (Small) p. 363 Bottom Line Change "Figure 27" To "Figure 26" p. 372 Line 5 from bottom Change "extends Chores" To "extends ChoresAdapter" p. 377 Line 7 Omit "repaint();" p. 420 Line 15 Change "read and write blocks of data to and from the buffer" To "read blocks of data into the buffer" p. 421 Lines 19 and 20 Change "try { BufferedReader f =" To "BufferedReader f = null; try { f =" p. 452 Exercise 1b Change ".a[index]" To "a[index]" p. 468 Line 4 Change "applet.repaint()" To "repaint()" p. 476 Line 20 Change "Example 11.9 revises Example 11.8" To "Example 11.8 revises Example 11.7" p. 481 Line 10 from the bottom Change "file://c:/java/TryURL.java/" To "file:///c:/java/TryURL.java/" p. 483 Line 3 from bottom Change "Server" To "ReverseServer" p. 512 Answer 3 Change "a. 3 b. 3 c.3 d. 3" To "a. 3,false b. 3,true c. 13,true d. 3,false" p. 512 Answer 21 Change "26" To "28" p. 512 Add Answer 23 Add "23. 26" p. 512 Answer 31a Change "I like to write Java programs." To "I like to write Java programs." p. 514 Answer 23 Change "BigNumber" To "BigInteger" p. 515 Answer 19c Change "z" To "w" p. 516 Omit Answers 25 and 27 FIRST AND SECOND PRINTINGS p. 4 Line 19 Change "takes" To "take" p. 60 Line 20 Change "the a bank" To "the bank" p. 86 Exercise 9a Change to if (y <= 6) z += 5; p. 95 Line 9 from the bottom Change "Example 3.5" To "Example 3.6" p. 110 Line 4 from the bottom Change "3.9" To "3.10" p. 183 Line 17 Add another line String s = "a houseboat"; Line 19 Change " "ho"+"use" " To "s.substring(2,7)" p. 190 Exercise 2 Add "String s = "a good time"; Change "String s2 = "time";" To "String s2 = "s.substring(7,11);" p. 206 Figure 5.12 Add the following method: public ScaleableCircle(Point p, int r) { super(p,r); } p. 223 Top line Change "public abstract" To "abstract" p. 246 Bottom line Change "8" To "9" p. 254 Exercise 14, middle line Change "myarray" To "myArray" p. 257 Figure 6.24 Change "score" To "student" four times p. 263 Example 6.9 Put the display method inside the InsertionSort class. p. 283 Line 6 Change "chapter 10" To "Chapter 11" p. 292 Top line Change "is" To "in" p. 293 Line 9 Change "connecting the points 30 pixels away from each corner." To "of an oval of diameter 30 in each direction." p. 295 Note 2 Change "between points 40 pixels from the corner" To "of a circle of diameter 40." p. 295 Line 19 Change "7.2" To "7.3" p. 327 Line 3 from bottom Change "eventGetSource()" To "event.getSource()" p. 328 Line 10 from bottom Align "// Note 3" with the other notes and make it bold. p. 339 Note 12 Change "use selected" To "user selected" p. 341 Line 7 from bottom Change "addItem" To "add" p. 349 Lines 1 and 2 from bottom and p. 353 Lines 7 and 8 Change "static int" To "static final int" p. 356 Line 12 from bottom Change "Integer." To "Integer" p. 370 Line 17 Change "left" To "right" p. 374 Line 5 from bottom Change "user" To "uses" p. 375 Line 15 from bottom Change "use" To "user" p. 376 Line 11 from bottom Change "shift" To "control" p. 386 Line 12 Change "mplements" To "implements" p. 396 Line 4 from bottom Change "keyPressed" To "keyTyped" p. 397 Line 19 Change "keyTyped" To "keyPressed" p. 415 Example 10.4 Change "int i = anArray[index]; return i;" To "return anArray[index];" p. 421 bottom line Change " '|' " To " "|" " p. 452 Exercise 4 Change " Monospaced " To " "Monospaced" " p. 464 Line 7 from bottom Change "mplements" To "implements" p. 476 Before Line 14 from the bottom Add public void init() { ... buffer = createImage(getSize().width,getSize().height); bufferGraphics = buffer.getGraphics(); } p. 483 Line 11 from bottom Change "getOuputStream" To "getOutputStream" p. 485 Line 14 from bottom Change "ReverseSever" To "ReverseServer" p. 488 Exercise 3 Change "class" To "class or interface" p. 500 Bottom line Change to "text are 8 for '\b', 9 for '\t', 10 for '\n' and 13 for '\r'." p. 501 Line 8 Change "www.inprise.com/programs/education/jbuilder/whatjbue.html" To "www.borland.com/education/jbuilder/jbue.html" p. 506 Line 16 Change "java" To "javac" p. 509 Answer 12e Change "-1" To "-2" p. 509 Answer 15d Change "1" To "4" p. 509 Answer 18e Change "102" To "136" p. 510 Answer 4a Change "false" To "true" p. 510 Answer 11a Omit the arrow in the middle of the graph. p. 510 Change Answer 12 to Answer 13. p. 515 Answer 15 Change "50*random()" or "450*random()" To "450*Math.random()" p. 516 Answer 9 Omit "Applet" p. 520 Answer Chapter 3, Question 4 Change "b" To "c" p. 521 Answer Chapter 4, Question 5 Change "a" To "b" p. 521 Answer Chapter 7, Question 3 Add " p. 523 Chapter 10 Exercise 2 Change " text.data " To " "text.data" " p. 523 Chapter 10 Exercise 3 Change " text.out " To " "text.out" " p. 523 Chapter 11 Exercise 4 Change "c" To "b"