Head First Java by Kathy Sierra, Bert Bates The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated August 26, 2004. UNCONFIRMED errors and comments from readers: {8} part 2 do something again and again; example of the for loop is "for (; x< 10; x = x+1)" there's no control variable in the for loop (59) First paragraph; The figure represents object reference Dog and its object is not consistent with the UML class diagram. The UML class diagram depicts that the Dog class has only one instance variable(or field) name, but the figure depicts another instance variable size of int type. (64) Second paragraph (on the left) ; Under the Tip paragraph: The sentence: "..you probably need to draw diagrams like the one on page 10 and 12..." should be changed to: "..you probably need to draw diagrams like the one on pages 57 and 58..." [66] Exercise B solution - class Hobbits; If you run the Hobbits class as listed in the solution, you will get an array index out of bounds exception when z = 2. z is immediately incremented to 3 and and there is no h[3] array position. Once correct version of the code would be: class Hobbits { String name; public static void main(String [] args) { Hobbits [] h = new Hobbits [3]; int z = 0; while (z < 3) { h[z] = new Hobbits(); h[z].name = "bilbo"; if (z == 1) { h[z].name = "frodo"; } if (z == 2) { h[z].name = "sam"; } System.out.print(h[z].name + " is a "); System.out.println(" good Hobbit name"); z = z+1; } } } {78} lower right example of code; The example of code reads: public void setHeight(int ht) { if (height > 9) { height = ht; } } as an example of a "setter" protecting the value of height it would make more sense if it read: public void setHeight(int ht) { if (ht > 9) { height = ht; } } [87] A method can have many of these________ (7th row down on "Who am I"); The sentence on page 72..."A method uses parameters, A caller passes arguments" contradicts the question on "Who am I" where it asks "A method can have many of these______". From my understanding I thought it was parameters but you have the answer as arguments. (295) next to last line in program; The statement: String finish = generic.replace(',',nullChar); does not work, nor will it work with replaceAll() function. This is the only way I could remove the commas: String finish = generic.replaceAll(",",""); This is a big surprise in Java 1.4.2 (360) In the Side bar of the bottom of the page; At the bottom of the page, the code snipet in the Side bar has a typo. Note the second statement that creates an inner object: MyOuter.MyInner innerObj = outerObj.new Inner(); should be changed to: MyOuter.MyInner innerObj = outerObj.new MyInner(); (378) Pool Puzzle, in MyDrawP class; public void paintComponent( (Graphics ________) { should read: public void paintComponent //there was an extra parenthesis (Graphics ________) { {386} pulbic void go(); Add this line: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); {387} pulbic void go(); Add this line: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); [412] 3rd Rule Example Code; The method declaration does not match the EJB-QL example. Either change: WHERE m.genre = ?2 AND m.director.degrees < ?1 ... to: WHERE m.genre = ?2 AND m.director.directorId < ?1 Or change: public String ejbHomeListMoviesByDirectorAndGenre(String dirID, String genre) ... to: public String ejbHomeListMoviesByDirectorAndGenre(String degrees, String genre) Basically, argument 1 in the EJB-QL implies Director.degrees, whereas argument 1 in the method implies Director.directorId [429] code outline; The code outline for QuizCardBuilder contains three inner classes... all implemented as *public*. OPPS! This code will not compile as only one public class definition may be contained in a single source file. As the rule goes, or something like it. The inner classes should be implemented with default visibility, i.e. ... class SaveMenuListener implements ActionListener { } ... This is error repeated in the complete code on Page 431. [547] pg 547-MyRemoteImp1.java ------ pg 549-MyRemoteClient.java; I have Windows 98 SE. MyRemoteImp1.java & MyRemoteClient.java compiled fine, but when I ran MyRemoteImp1.java I got a url error. So I changed the following and it compiled and ran fine. page 547 in MyRemoteImp1.java Naming.rebind("Remote Hello", service); to Naming.rebind("RemoteHello", service); (I took out the space) page 549 in MyRemoteClient.java MyRemote service = (MyRemote) Naming.lookup("rmi://127.0.0.1/Remote Hello"); to MyRemote service = (MyRemote) Naming.lookup("rmi://127.0.0.1/RemoteHello"); (I took out the space) {449} DungeonTest code; Should include "import.java.io.*;" just above "class DungeonTest". {550} Second graphic on page (server description); Classes shown include a duplication of MyServiceImpl_Stub.class, and no MyServiceImpl.class. Also, it seems that the graphic is a blend of the MyService example and the MyRemote example.