ERRATA for Objects to Components with the Java(TM) Platform Copyright 2000, Art Gittleman p. 26 Remove footnote 16 p. 48 Exercise 2 Add "String s = "a good time"; Change "String s2 = "time";" To "String s2 = "s.substring(7,11);" p. 51 Line 3 Change "aCook" To "cook" p. 51 Line 4 Change "aWaiter" To "waiter" p. 51 Lines 5 and 6 Change "aCustomer" To "customer" p. 59 Line 1 Omit "import iopack.Io;" p. 80 Line 16 Change "1.6" To "1.7" p. 87 Line 10 and p. 88 Line 8 Change "Example 2.1" To "Example 2.3" p. 89 Line 13 Change "CheckingAccount" To "CheckingAccount subclass" p. 127 Line 11 Change "3.1" To "3.6" p. 137 Lines 16-18 Omit the sentence starting "In Figure 4.13..." p. 146 Line 3 Change "int[] scores" To "int[][] scores" p. 170 Exercise 22 Change "1 0 6" To "10 6" p. 184 Exercise 9 Change "is" To "in" p. 253 Lines 5 and 6 from bottom and p. 257 Lines 14 and 15 Change "static int" To "static final int" p. 274 Bottom line Change "left" To "right" p. 276 Line 7 from bottom Change "mothod" To "method" p. 276 Line 10 from the bottom Change "mouse motion" To "mouse" p. 277 Lines 10, 11, 12, and 21 Omit the semicolon at the end of the line. p. 280 Line 17 from bottom Change "use" To "user" p. 298 Lines 3 and 4 Change ".Math" To "Math" p. 330 Line 5 from the bottom. Change "various" To "last two" p. 330 Line 5 from the bottom. Insert "The read() method returns the byte read, or -1 if at the end of the file" p. 334 Line 8 from bottom Change "BankAccount" To "SavingsAccount" p. 334 Line 11 from the bottom. Change "the these" To "these" p. 402 Align Exercise 21 with the other exercises. p. 413 Remove Line 3 "BufferedReader input;" p. 421 Line 18 Change "ReverseSever" To "ReverseServer" p. 427 Line 16 Change "socket" To "server" p. 431 Lines 4 and 6 Change "ThreadedWebServer" To "ThreadedWebServer 11111" p. 435 Line 2 from bottom Change "}" To "};" p. 447 Figure 11.4 Change "SalepersonID" To "SalespersonID" p. 453 After Line 12 Add "3. Select MS Access Database." Renumber 3-10 as 4-11. p. 453 Before line 11 from the bottom Add "3. Select Text Files." Renumber 3-7 as 4-8. p. 456 Line 10 Change to "stmt.executeUpdate ("INSERT INTO Item VALUES ('555555','CD player',10)"); p. 465 Line 9 Change "COLUMN_NAME" To " "COLUMN_NAME" " p. 465 Line 11 Change "TYPE_NAME" To " "TYPE_NAME" " p. 467 Lines 19 and 20 (marked by Note 5) Put both double quotes on one line so it looks like + " " + p. 471 Line 8 Change ", i++" To "; i++" p. 471 Line 10 Change "number" To "numbers[i]" p. 472 Lines 22 and 24 Change "pStst" To "pStmt" p. 474 Line 30 Move "con.setAutoCommit(false);" to p. 473 line 12 from the bottom. p. 489 Line 15 from bottom Change "(CustomerName)" To "("CustomerName")" p. 499 Line 7 from the bottom Change "10.8" To "12.8" p. 502 Change "Figure 12.1" To "Figure 12.12" p. 505 Line 4 from the bottom Change "TestBean.mf" To "TextBean.mf" p. 512 Add new line 2 "Integer oldage = new Integer(age);" p. 516 Line 10 p. 519 Lines 5, 7, and 12 Change "EventDescriptor" To "EventSetDescriptor" p. 520 Exercise 12 Change "GetEventDescriptors" To "GetEventSetDescriptors" p. 524 Example 12.7 Change "smile=(Smiley)Beans.instantiate(null,"smiley.Smiley");" To "ClassLoader cl = this.getClass().getClassLoader(); smile=(Smiley)Beans.instantiate(cl,"smiley.Smiley");" p. 528 Exercise 18 Change "payLowered" To "payCut" p. 537 Line 10 Change "i > 16; i--" To "i > 6; i -= 5" p. 552 Bottom line Change to "text are 8 for '\b', 9 for '\t', 10 for '\n' and 13 for '\r'." p. 570 The diagram in the answer to 7b should have 8 boxes instead of 7. p. 575 Chapter 10 Answer 3 Change to "The program displays the HTML file, index.html, with all the HTML tags." p. 579 Chapter 5 Answer 3 Add "" p. 581 Chapter 9 Answer 4 Change "c" To "b" The answers to even Test Your Understanding exercises (found on the floppy included with the text). Chapter 2 answers should read 2. a. false b. false c. true d. true e. true 4. One scenario follows. The customer might instead cancel the order and leave. The customer orders a burger, soda, and fries from the waiter. The waiter informs the customer that the drink machine is broken. The customer orders water instead of soda. The waiter asks the cook to make a burger. The waiter serves the water to the customer. The waiter asks the cook to make the fries. The cook gives the waiter the burger to serve. The cook gives the waiter the fries to serve. The waiter asks the customer to pay. 6. private int accountNumber; 8. BankAccount theAccount = new BankAccount(); 10. a. myAccount.deposit(35.50); b. myAccount.getBalance(); c. myAccount.deposit(999.00); 12. Method deposit(int) not found in class TestBankAccount (or something similar) 14. public void withdraw(){ if(balance >= 40.00) balance -= 40.00; else System.out.println("Insufficient funds"); } 18. Name me = new Name("Arthur", 'P', "Gittleman"); 20. String i = "123-45-6789"; Name n = new Name("Peter", "Pan"); Address a = new Address("1512 Harbor Blvd.", "Long Beach", "CA", "99919"); Person p = new Person(i,n,a);