Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
Printed | Page xxv bottom right on xxv |
headfirstjava.com is listed for downloading the code - but the site doesn't seem to be related to the book - did they lose the URL? Note from the Author or Editor: |
Tony Martin | May 20, 2010 | |
Printed | Page 195 Mixed Messages |
The two last lines matching candidate code and output are out of place (lower than they should be). Note from the Author or Editor: |
Marcos Maximo | Jan 06, 2010 | |
Printed | Page x Chapter 6 first contents line |
Line reads |
Anonymous | ||
Printed | Page xx Point 3 under "Who should probably back away from this book?" |
Reads: |
Anonymous | ||
Printed | Page xxiv 2nd paragraph |
to increase the chance that the content gets coded coded into more |
Anonymous | ||
Printed | Page xxvi In the box SETTING UP JAVA, sentence at bottom of first bullet reads: |
"Note: there is no Java 2 pre-OS X Mac operating systems" |
Anonymous | ||
Printed | Page 1 |
JButton button = new JButton("Roll |
Anonymous | ||
Printed | Page 2 |
The next line |
Anonymous | ||
Printed | Page 3 source code snippet |
missing semi-colon after the statement "Button c = new Button("Shoot me")" |
Anonymous | ||
Printed | Page 8 3rd |
if ((x < 3) & (name.equals("Dirk")) { |
Anonymous | ||
Printed | Page 8 Syntax Fun -- Under 4th bullet (star) |
Reads: |
Anonymous | ||
Printed | Page 9 code example in right hand column |
int x = 4; // assign 3 to x |
Anonymous | Aug 01, 2003 | |
Printed | Page 10 Code at the upper right corner |
System.out.println("Value of x is " + x); 2nd quotation mark " is pointing in the wrong direction. |
Anonymous | ||
Printed | Page 11 "Sharpen your Pencil" |
The command specified under "Given the output:" : |
Anonymous | Aug 01, 2003 | |
Printed | Page 12 Code |
Lines 9, 10 & 15 |
Anonymous | ||
Printed | Page 14 Code - Part 1 -- Inside of wordListTwo initialization |
The third word in the wordListTwo array reads: |
Anonymous | ||
Printed | Page 15 2nd sentence under item #1 - |
"Declaraing" |
Anonymous | Aug 01, 2003 | |
Printed | Page 15 Far Right Column |
The first few lines of the example reads as follows: |
Anonymous | ||
Printed | Page 22 snippets on the leftmost side of the pool |
System,out,print("an"); |
Anonymous | ||
Printed | Page 22,24 Pool Puzzle and Solution |
The Pool Puzzle snippets have |
Anonymous | ||
Printed | Page 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 |
Anonymous | Aug 01, 2003 | |
Printed | Page 28 image, center of the page |
1st amoeba: |
Anonymous | ||
Printed | Page 28 Bottom second column |
The sentence says: "...he added an attribute that all Ameboas would have". |
Anonymous | ||
Printed | Page 32 Last paragraph |
First sentence reads: |
Anonymous | Aug 01, 2003 | |
Printed | Page 41 Code Magnets code snippets |
In the two following code snippets "System.out.print" now reads "System.out.println" |
Anonymous | Aug 01, 2003 | |
Printed | Page 45 Who Am I answers |
The 7th item in answers says |
Anonymous | ||
Printed | Page 50 bottom of 2nd paragraph in right margin |
"compiler always errors" |
Anonymous | ||
Printed | Page 51 Last paragraph |
The last sentence of the last paragraph is cut off. It reads: |
Anonymous | Aug 01, 2003 | |
Printed | Page 54 There are no dumb questions, first answer, second sentence |
theJVM's development team |
Anonymous | ||
Printed | Page 54 There are no dumb questions, first answer, last sentence |
... allocation issues, you're Big Concern |
Anonymous | ||
Printed | Page 58 Text against number (2) |
Text reads: |
Anonymous | Aug 01, 2003 | |
Printed | Page 61 left column |
in class BooksTestDrive, the next to last statement is |
Anonymous | Aug 01, 2003 | |
Printed | Page 66 right column |
in class BooksTestDrive, the next to last statement is |
Anonymous | Aug 01, 2003 | |
Printed | Page 72 4th paragraph |
Currently - |
Anonymous | Aug 01, 2003 | |
Printed | Page 76 There are no dumb questions, last answer, last sentence |
In Java, You don't... |
Anonymous | ||
Printed | Page 83 'there are no dumb questions' - last paragraph, the 5th sentence |
So parameters are ALWAYS initialized, because they compiler... |
Anonymous | ||
Printed | Page 84 under (To compare two primitives, use the == operator), 4th and 5th sentence. |
"(although it doesn't care about the size of the variable, so all the extra zeroes on |
Anonymous | ||
Printed | Page 84 Last sentence, last paragraph |
"it will be same for two references to a single object." |
Anonymous | ||
Printed | Page 87-91 Exercise and Solution |
The solution on page 91 used many "attendees" names that are not consistent with the |
Anonymous | ||
Printed | Page 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" Note from the Author or Editor: |
Anonymous | ||
Printed | Page 94 'Part of a game interaction' |
Ouch! you sunk Go2.com |
Anonymous | ||
Printed | Page 105 Sharpen your pencil |
In the pseudocode for the method, the following statement: |
Anonymous | ||
Printed | Page 106 Second paragraph |
"COMPUTE a random number between 0 and 5 that will be the starting location cell position" |
Anonymous | ||
Printed | Page 111 interaction box in left column |
On page 108, the code for the SimpleDotComGame says that if the dot com is killed, |
Anonymous | ||
Printed | Page 114 |
In the box Converting a String to an int, the line that reads: |
Anonymous | ||
Printed | Page 129 Bottom of page (numeral 8) |
myList.remove(s); |
Anonymous | ||
Printed | Page 146 Third method (checkYourself()) |
"if (locationCells.isEmpty())" |
Anonymous | ||
Printed | Page 157 8th code magnet |
Current: |
Anonymous | Aug 01, 2003 | |
Printed | Page 157 Sixth code block |
"public class ArrayList6 {" |
Anonymous | Aug 01, 2003 | |
Printed | Page 173 4th paragraph |
The sentence: |
Anonymous | ||
Printed | Page 190 Right column |
In the third line of the TestBoats class definition: |
Anonymous | ||
Printed | Page 200 3rd paragraph |
"so Canine, for example, could implement an abstract class from Animal" |
Anonymous | ||
Printed | Page 203 Bottom of the page, in the outputbox |
% java AnimalListUser |
Anonymous | ||
Printed | Page 204 middle of the page |
This is just a simple formatting error. On page 204 in the second paragraph under |
Anonymous | ||
Printed | Page 204 7th paragraph (2nd from bottom) |
simple typo: |
Anonymous | ||
Printed | Page 205 The UML class diagram for the Object class |
In the Object diagram: |
Anonymous | ||
Printed | Page 207 note in margin |
Simple typo: |
Anonymous | ||
Printed | Page 208 1st hand-written note |
The text |
Anonymous | ||
Printed | Page 210 Middle of First Paragraph |
-a Snowboard obect- |
Anonymous | ||
Printed | Page 212 paragraph on the right |
varaiable, |
Anonymous | Aug 01, 2003 | |
Printed | Page 212 Code at the very bottom of the page |
if (d instanceof Dog) |
Anonymous | ||
Printed | Page 230 Who Am I answer section |
The answer on page 230 says "I can look different to different people" and the |
Anonymous | ||
Printed | Page 234 The paragraph above the the illustrated picture |
The paragraph just above the illustrated drawing of the stack: |
Anonymous | ||
Printed | Page 235 Fourth paragraph |
"object's it holds references to?" |
Anonymous | ||
Printed | Page 239 2nd paragraph |
"whose" should be "who is" |
Anonymous | ||
Printed | Page 244 Answer block bottom lhs third line up |
Death-by-Dhocolate Brown ought to be Death-by-Chocolate Brown |
Anonymous | ||
Printed | Page 245 right column, first answer in Q&A |
"default accessn chapter 16 and appendx B" |
Anonymous | ||
Printed | Page 249 Footnote within the sidebar box (i.e. very last sentence) |
The footnote states: |
Anonymous | Aug 01, 2003 | |
Printed | Page 249 last paragraph |
in the sentence |
Anonymous | ||
Printed | Page 250 Second paragraph, first sentence |
"Look at the Stack series on page 17 again," |
Anonymous | Aug 01, 2003 | |
Printed | Page 255 The Stack Figures |
The text just below the Stack figures in item 2 and item 4: |
Anonymous | ||
Printed | Page 277 First paragraph |
"trying to make an new instance of the class," |
Anonymous | ||
Printed | Page 280 Thirteenth bullet point (assuming one-based indexing). |
"Assign a value to a final instance variable must be either at the time it is |
Anonymous | ||
Printed | Page 297 four lines from bottom |
You can't guarnatee |
Anonymous | ||
Printed | Page 297 3 lines from bottom |
And we have to this now. |
Anonymous | ||
Printed | Page 299 3rd paragraph ("The JavaSound API") |
"Musical Insrument Digital Interface" |
Anonymous | Aug 01, 2003 | |
Printed | Page 299 Last line first paragraph |
".....send something to the another machine." |
Anonymous | ||
Printed | Page 299 Paragraph starting with "MIDI data says..." |
"Jimmy Hendrix" should read "Jimi Hendrix" |
Anonymous | ||
Printed | Page 303 Letters between Compiler and Geeky |
In the letter from the compiler to Geeky he says |
Anonymous | ||
Printed | Page 306 'handwritten' text next to diagram |
They're knows as (big surprise here)... |
Anonymous | ||
Printed | Page 307 metacognitive tip |
4 lines from bottom of first paragraph: |
Anonymous | Aug 01, 2003 | |
Printed | Page 318 The Stack Figures |
In the Stack figure, the laundry method should be changed to doLaundry method. |
Anonymous | ||
Printed | Page 322 First Sentence on page |
The first sentence reads: |
Anonymous | ||
Printed | Page 324 example |
The MIDI sound examples' process never terminates, so after you run it, |
Anonymous | ||
Printed | Page 328 First paragraph, class definition |
"public class MiniMusicCmdLine" |
Anonymous | Aug 01, 2003 | |
Printed | Page 340 Paragraph Beginning: An event source; second line |
Most the code you write |
Anonymous | ||
Printed | Page 340 3rd paragraph |
If you want MouseEvents, implement the MouseEvent interface. |
Anonymous | ||
Printed | Page 341 1st sentence under "The Listener" section |
"If your class wants to to know..." |
Anonymous | ||
Printed | Page 342 Program SimpleGui1B method "go" |
There is a line missing from the method: |
Anonymous | Aug 01, 2003 | |
Printed | Page 342 1st Paragraph Item number 3 in the list |
interrface should be spelled interface. |
Anonymous | ||
Printed | Page 345 First bullet, second line |
"Add buttons, menus, radion buttons, etc." |
Anonymous | Aug 01, 2003 | |
Printed | Page 347 Section "Display a JPEG" |
Under the section "Display a JPEG", in the paragraph explained the drawImage method, |
Anonymous | ||
Printed | Page 348,350,379 misc. |
all references to Graphics2d should be Graphics2D (capital D). Using Graphics2d will |
Anonymous | ||
Printed | Page 352 'Sharpen your pencil' section at the bottom of the page |
It says: |
Anonymous | Aug 01, 2003 | |
Printed | Page 353 The bottom of the page |
At the bottom of the page, in the paintComponent method, the comment refered to an |
Anonymous | ||
Printed | Page 356 the third class on the page (LabelButtonListener), line3 |
it says: |
Anonymous | Aug 01, 2003 | |
Printed | Page 358 2nd column, 2nd paragraph |
Change: |
Anonymous | ||
Printed | Page 370 Top of the page, right hand column |
The bullet points are numbered incorrectly; |
Anonymous | ||
Printed | Page 374 Top right paragraph (Sharpen Your Pencil) |
"It builds directoy on Version Two." should read |
Anonymous | ||
Printed | Page 374 Second method. |
There appears to be an extra space between public and void in the method line: |
Anonymous | ||
Printed | Page 385 BorderLayout para line 4 |
"layed out" should be "laid out" |
Anonymous | ||
Printed | Page 385 Dumb Question, 2nd sentence |
Change: |
Anonymous | ||
Printed | Page 394 Bullet Point 7 |
"FlowLayout places components lleft to right" |
Anonymous | ||
Printed | Page 404 middle of the page |
track.add(makeEvent(192,9,1,0,15)); |
Anonymous | ||
Printed | Page 407 after bullet point c |
The bullet point after C should be D. In the book it is A; thus the sequence is : |
Anonymous | ||
Printed | Page 425 1st Paragraph |
The code on this page uses GameCharacter which is mentioned on page 413, however |
Anonymous | ||
Printed | Page 425 2nd try block |
System.out.println(one.getPower() + "," + one.getType() + "," + one.getWeapons()); |
Anonymous | ||
Printed | Page 427 2nd paragraph last sentence |
"FileInputStream" |
Anonymous | Aug 01, 2003 | |
Printed | Page 429 3rd 'side note' |
"triggered when use chooses...." |
Anonymous | ||
Printed | Page 434 try block in sample code on page |
File myFile = new File("MyText.txt); |
Anonymous | ||
Printed | Page 436 Title at top of page, and class definition. |
"Quiz Card Reader code" |
Anonymous | ||
Printed | Page 437 top of the page in the NextCardListener class |
the last line of the classes' method uses a deprecated method on the JButton nextButton : |
Anonymous | Aug 01, 2003 | |
Printed | Page 437 first block of 'handwritten' text |
in the first block of handwritten text, the word viewing is spelt incorrectly: |
Anonymous | ||
Printed | Page 441 Bottom of first column, last sentence above the command window |
that ships with you Java development kit. |
Anonymous | ||
Printed | Page 448 front card questionnaire |
What's the first foreign country due south of Detroit Michigan? |
Anonymous | ||
Printed | Page 459 2 Make a PrintWriter |
Code fragment: |
Anonymous | ||
Printed | Page 459 Bullet item #2, notes. |
"PrintWriter acts as it's own bridge" |
Anonymous | ||
Printed | Page 463 Bullet item #3 |
"The accept() method blocks (just sits there) while its waiting" |
Anonymous | ||
Printed | Page 469 1st sentence of 1st paragraph |
"We want something to run continusouly..." |
Anonymous | ||
Printed | Page 478 Code block, first bullet point #1 |
"myThread .start();" |
Anonymous | ||
Printed | Page 482 1st Paragraph |
The second line of the very first paragraph refered to an incorrect page number: |
Anonymous | ||
Printed | Page 482 Bottom of the page |
class ThreadTester { |
Anonymous | ||
Printed | Page 487 Last line on page |
Missing a closing "}" |
Anonymous | ||
Printed | Page 490 5th paragraph from the top |
So, if you don't lock the back account |
Anonymous | ||
Printed | Page 500 First line of Ready-bake Code |
"mport java.io.*;" |
Anonymous | ||
Printed | Page 502 Last Answer Block, next to the last paragraph (bottom right of page) |
before Ryan has a chance to wakes up |
Anonymous | ||
Printed | Page 518 2nd paragraph, first example of javac -d ..... |
The side description of the first example says |
Anonymous | ||
Printed | Page 518 Last set of notes, under "$java com.headfirstjava.PackageExercise". |
"JVM will see that, and immediately look inside it's" |
Anonymous | ||
Printed | Page 527 1st sentence |
To make a Java Web Start app, you to .jnlp |
Anonymous | ||
Printed | Page 527 First paragraph |
<homepage href="index.html/> |
Anonymous | ||
Printed | Page 540 Note on right-hand side of page |
"Your client object ge to" |
Anonymous | ||
Printed | Page 546 first para line 12 |
"Remember, must be able to see......" |
Anonymous | ||
Printed | Page 547 Last note on page. |
"rmiregistery using the static" |
Anonymous | ||
Printed | Page 554 3rd and 5th paragraphs |
The description for the step is the same for steps 3 and 5. The one for step 5 should be different. |
Anonymous | ||
Printed | Page 555 4th "scribble" note from the top on the right-hand side. |
'thing' is coming back from the server as a reuslt of |
Anonymous | ||
Printed | Page 556 Bullet point 5 penultimate line |
extra space between y and ou |
Anonymous | ||
Printed | Page 556 "There Are No Dumb Questions", the Answer section, paragraph 3. |
"response. Imagine a reasonably complext HTML page, and now" |
Anonymous | ||
Printed | Page 560 Para 5 last line |
"intereted" should be "interested" |
Anonymous | ||
Printed | Page 560 4th line from bottom of page |
"do you have anything implements..." |
Anonymous | ||
Printed | Page 560 last line of page |
"Here's the serialized object the Scientific Calculator service registered with me." |
Anonymous | ||
Printed | Page 567 Top two graphics on right-hand side of page |
Instead of a diagram of the ServiceServer and ServiceServerImpl, there are two |
Anonymous | ||
Printed | Page 572 definition of class DiceService |
In the definition of the method getGuiPanel() two lines have been truncated: |
Anonymous | ||
Printed | Page 592 Second line of Foo Class snippet |
The line incorrectly ends with an opening square bracket [ -- it should be an opening brace { |
Anonymous | ||
Printed | Page 600 LinkedHashSet |
Per the JDK_1.4.2/docs/api, LinkedHashSet does not implement iteration in order of most recently accessed; |
Anonymous |