Head First Java by Kathy Sierra, Bert Bates Following are the changes made in the 8/03 reprint. [9] code example in right hand column; int x = 4; // assign 3 to x now reads int x = 4; // assign 4 to x x = x + 1; // or we'd loop forever now reads: x = x - 1; // or we'd loop forever {11} "Sharpen your Pencil"; The command specified under "Given the output:" : % java Test now reads % java DooBee (15) 2nd sentence under item #1 - "Declaraing" now reads: Declaring [23] code at top of right-hand column (exercise A); The comments state that the code would run forever without a line added to the program, however the line added in the answer would not prevent infinite looping: class Exercise1b { public static void main(String[] args) { int x=1; while (x<10) { x=x-1; //THIS IS THE ADDED LINE if (x>3) { System.out.println("big x"); } } } } The added line now reads x = x + 1; (32) Last paragraph; First sentence reads: "So objects have instance and variables and methods,..." now reads: "So objects have instance variables and methods,..." {41} Code Magnets code snippets; In the two following code snippets "System.out.print" now reads "System.out.println" void playTopHat() { System.out.print("ding ding da-ding"); } void playSnare() { System.out.print("bang bang da-bang"); } additionally, to create the specified output "bang bang da-bang" now reads "bang bang ba-bang" The code is given correctly in the exercise solutions on page 44. (51) Last paragraph; The last sentence of the last paragraph is cut off. It reads: "Don't worry, by the end of the book you'll have most of" The continuation now reads: "these memorized". (58) Text against number (2); Text reads: Create a new int array with a length of 7 now reads: Create a new Dog array with a length of 7 (61) left column; in class BooksTestDrive, the next to last statement is System.out.println(myBooks[x].Author); now reads: System.out.println(myBooks[x].author); (66) right column; in class BooksTestDrive, the next to last statement is System.out.println(myBooks[x].Author); now reads: System.out.println(myBooks[x].author); (72) 4th paragraph; Currently - If a method takes an parameter ... now reads - If a method takes a parameter ... {157} 8th code magnet; Current: for (int z = 0; z < a.size(); z++) { now reads: for (int z = 0; z < al.size(); z++) { {157} Sixth code block; "public class ArrayList6 {" now reads: "class ArrayList6 {" to be consistent with the solution on page 159. Alternatively, "class ArrayList6 {" on page 159 now reads: "public class ArrayList6 {" to be consistent with the Code Magnets exercise on page 157. (212) paragraph on the right varaiable, now reads variable, (249) Footnote within the sidebar box (i.e. very last sentence); The footnote states: "... (you'll see that on page 22)." now reads: "... (you'll see that on page 252)." (250) Second paragraph, first sentence; "Look at the Stack series on page 17 again," now reads "Look at the Stack series on page 248 again" (299) 3rd paragraph ("The JavaSound API"); "Musical Insrument Digital Interface" now reads "Musical Instrument Digital Interface" (307) metacognitive tip; 4 lines from bottom of first paragraph: you're now reads you've {328} First paragraph, class definition; "public class MiniMusicCmdLine" now reads: "public class MiniMiniMusicCmdLine" to match the instantiation of the object two lines down. Alternatively, "MiniMiniMusicCmdLine mini = new MiniMiniMusicCmdLine();" now reads: "MiniMusicCmdLine mini = new MiniMusicCmdLine();" to match the class definition (MiniMusicCmdLine). [342] Program SimpleGui1B method "go"; There is a line missing from the method: Method reads: public void go() { JFrame frame = new JFrame(); button = new JButton("click me"); button.addActionListener(this); frame.getContentPane().add(button); frame.setSize(300, 300); frame.setVisible(true); } Now reads: public void go() { JFrame frame = new JFrame(); button = new JButton("click me"); button.addActionListener(this); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Missing frame.getContentPane().add(button); frame.setSize(300, 300); frame.setVisible(true); } (345) First bullet, second line; "Add buttons, menus, radion buttons, etc." "radion" now reads "radio" (352) 'Sharpen your pencil' section at the bottom of the page; It says: Given the pictures on page 17 ... it now reads: Given the pictures on page 351 ... [356] the third class on the page (LabelButtonListener), line3; it says: label.setLabel("That Hurt!"); It now reads: label.setText("That Hurt!"); (427) 2nd paragraph last sentence; "FileInputStream" now reads: "FileOutputStream" {437} top of the page in the NextCardListener class; the last line of the classes' method uses a deprecated method on the JButton nextButton : nextButton.disable() now reads nextButton.setEnabled(false);