Errata


Print Print Icon

Submit your own errata for this product.


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 "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



Version Location Description Submitted By Corrected
Printed Page xxx
2nd paragraph

"...has her SCPJ 1.4 and SCWCD..."
should be:
"...has her SCJP 1.4 and SCWCD..."
^^

Anonymous 
Printed Page xxvii
10th bullet

For long examples or Ready-bake code, you can download the source files
from headfirstjava.com
->
For long examples or Ready-bake code, you can download the source files
from wickedlysmart.com

########################################

Anonymous  Feb 2007
Printed Page 5
2nd paragraph after "A:"

Sentence reads,
So, the original Java was versions 1.02 (the first official release) through 1.1 were just "Java".
Should read,
So, the original Java, versions 1.02 (the first official release) through 1.1, were just "Java".

Anonymous 
Printed Page 6
hand-written text after "System.out.print("Dog: " + name)

Sentence reads,

print out "Hello Fido"...

Should read,

print out "Dog: Fido"...

Anonymous 
Printed Page 9
+2

Load the Hello class
->
Load the MyFirstApp class

########################################

Anonymous  Feb 2007
Printed Page 10
Bullet 2 "do something again and again"

x = x -1
should be
x = x - 1

Anonymous 
Printed Page 24
at botton of page in pool puzzle

The Pool Puzzle snippets
System.out.print("a ");
System.out.print("n ");

should be:
System.out.print("a");
System.out.print("n");
(i.e., remove spaces)

and

System,out,print("an");
should be:
System.out.print("an");

Anonymous 
Printed Page 53
Just right below the 3 bullet rules

Just right below the last bullet of the rules.

"are keywords (and other things) that...."
It should be:
"Reserved words are keywords..."

Anonymous 
Printed Page 66
left column under "Tip"

on page 55 and 56
->
on page 55 and 57

########################################

Anonymous  Feb 2007
Printed Page 68
Solution to "Be The Compiler" exercise B

Should outdent the two boldface lines to match the prior line.

Anonymous 
Printed Page 99
"real code" paragraph

The "To Do" note obscures part of the text after "real code".

Anonymous 
Printed Page 135
Last ArrayList paragraph

The following line should end with a question mark:

But is it worth the miniscule performance gain to give up all this power.

Anonymous 
Printed Page 139
2nd comment

In the 2nd comment where says: "Change the String array to an ArrayList that holds
Strings" should say: "Change the int array to an ArrayList that holds Strings"
(You are changing from a int[] to a ArrayList<String>.)

Anonymous 
Printed Page 146
Annotations at bottom of page

In the K&B solution on page 148 for the "Sharpen your pencil" exercise on page 146,
there is an extra annotation that isn't one of the possible annotations listed at the
bottom of page 146. The "extra annotation" shown on page 148 is, "Make an ArrayList
of DotCom objects (in other words, a list that will hold ONLY DotCom obects, just as
DotCom[] would mean an array of DotCom objects).

Anonymous 
Printed Page 150
Code line: "public void setName..."

This line of code should be outdented to match the curly braces above and below.

Anonymous 
Printed Page 152
1st paragraph; 4th sentence (of the 2nd edition)

"We tried to keep it fairly small to you wouldn't have to type so much..."
should be:
"We tried to keep it fairly small so you wouldn't have to type so much..."

Anonymous 
Printed Page 154, 155, 157
References to "chapter 16"

All references to chapter 16 on these pages should be references to chapter 17.

Anonymous 
Printed Page 180
Note at end of page

Reference to chapter 16 should be a reference to chapter 17.

Anonymous 
Printed Page 187
1st hand-written paragraph

"The Animal parameter can take ANY Animal type as the argument."
Should be changed to:
"The 'a' parameter can take ANY Animal type as the argument."

Anonymous 
Printed Page 190
2nd-to-last box, line 2

public boolean turnOn()
->
public boolean turnOff()

########################################

Anonymous  Feb 2007
Printed Page 195
Mixed messages answer

Misaligned line objects make it unclear just what is the correct answer for this exercise.

Anonymous 
Printed Page 208
box, under "boolean remove"

Removes the object at the index parameter. Returns 'true' if the element
was in the last
->
Removes one instance of the object specified in the parameter. Returns
'true' if the element was in the list.

########################################

Anonymous  Feb 2007
Printed Page 209
References to chapter 17 and appendix B

References to "hashtables in chapter 17" should be changed to chapter 16.
References to appendix B should be removed.

Anonymous 
Printed Page 245
3rd paragraph

"clunkly" should read "clunky"

Anonymous 
Printed Page 247
+1

The class below is legal because all four constructors...
->
The class below is legal because all five constructors...

########################################

Anonymous  Feb 2007
Printed Page 247
gray box on top right

Four different constructors means four different ways to make a new mushroom.
->
Five different constructors means five different ways to make a new mushroom.

########################################

Anonymous  Feb 2007
Printed Page 254
Second paragraph

"Look at the Stack series on page 248 again."
The page number should be 252, because, thats where the Hippo stack is.

Anonymous 
Printed Page 260
1st paragraph

"The rules are the same for primtives and references."

"primtives" should read "primitives"

Anonymous 
Printed Page 266
doStuff2 method

The statement
GC localGC
must end in a semicolon.

Anonymous 
Printed Page 275
1st column, regular (non-static) method

Missing closing curly brace, "}", at the end of public class Song.

Anonymous 
Printed Page 292
4th line of code under "Converting a string..."

boolean b = new Boolean("true") .booleanValue();
->
boolean b = Boolean.parseBoolean("True");

########################################

Anonymous  Feb 2007
Printed Page 292
2nd annotation on page

You'd think there would be a Boolean.parseBoolean() wouldn't you? But there
isn't. Fortunately there's a Boolean constructor that takes (and parses) a
String, and then you just get the primitive value by unwrapping it

->

The (new to 1.5) parseBoolean() method ignores the cases of the characters
in the String argument.

########################################

Anonymous  Feb 2007
Printed Page 360
Getting a button's ActionEvent #3

Change:
"...method from the ActionListener interrface"
To:
"...method from the ActionListener interface"

Anonymous 
Printed Page 367
code at bottom

int red = (int) (Math.random() * 255);
int green = (int) (Math.random() * 255);
int blue = (int) (Math.random() * 255);
Color startColor = new Color(red, green, blue);

red = (int) (Math.random() * 255);
green = (int) (Math.random() * 255);
blue = (int) (Math.random() * 255);
Color endColor = new Color(red, green, blue);

->

int red = (int) (Math.random() * 256);
int green = (int) (Math.random() * 256);
int blue = (int) (Math.random() * 256);
Color startColor = new Color(red, green, blue);

red = (int) (Math.random() * 256);
green = (int) (Math.random() * 256);
blue = (int) (Math.random() * 256);
Color endColor = new Color(red, green, blue);

########################################

Anonymous  Feb 2007
Printed Page 370
in the note on the left; 2nd paragraph

regsion
should be:
region

Anonymous 
Printed Page 370
Sharpen your pencil box

Given the pictures on page 351
->
Given the pictures on page 369

########################################

Anonymous  Feb 2007
Printed Page 371
last line of code

// See page 347 for the code
->
// See page 365 for the code

########################################

Anonymous  Feb 2007
Printed Page 392
Sharpen your pencil

"It builds directoy..."
should read:
"It builds directly..."

Anonymous 
Printed Page 393
& <396> Entire page

Pages 393 and 396 are missing from the first printing. A PDF file of the missing pages
can be found here - http://examples.oreilly.com/9780596009205/HFJava_393_396.pdf

Anonymous 
Printed Page 396
code

The line
"public void paintComponent (Graphic" should read,
"public void paintComponent (Graphics" - the trailing "s" in "Graphics" is missing.

Anonymous 
Printed Page 409
Woman's thought bubble

The text should read, "I need to know how big the button wants to be..."
The word "be..." is missing.

Anonymous 
Printed Page 422
third handwritten comment from the bottom

"Let's..."
should read:
"Lets..."

Anonymous 
Printed Page 452
Rightmost comment

In the sentence, "A File object is like a street address... it represents the name
and location of a particular file..." the word "represents" appears to be crossed out
when it should be underlined.

Anonymous 
Printed Page 459
Make it Stick

The "Make it Stick" box is overlapping the "Bullet Points" icon.

Anonymous 
Printed Page 463
Last two lines of code

The last two lines of code should be outdented to line up with the first two lines.

Anonymous 
Printed Page 467
2nd sentence

Change the question mark at the end of this sentence to a period: "Reconstruct the
code snippets to make a working Java program that produces the output listed below?"

Anonymous 
Printed Page 481
Largest arrow paragraph

Change the sentence, "In other words, by the time you call a BufferedWriter method,
the writer doesn't know or care where the characters came from."

To: "In other words, by the time you call a BufferedReader method, the reader doesn't
know or care where the characters came from."

Anonymous 
Printed Page 485
7th bullet point, 3rd line

sock.getInputStream();
->
sock.getInputStream();
sock.getOutputStream();

########################################

Anonymous  Feb 2007
Printed Page 487
last annotation

Remember, the writer is chained to the input stream...
->
Remember, the writer is chained to the output stream...

########################################

Anonymous  Feb 2007
Printed Page 507
in function "public void run ()"

Typo on makeWithdrawl(10)
should be: makeWithdrawal(10)

Anonymous 
Printed Page 515
Thread B, 3rd paragraph

[now thread B is sent into a 'object lock not available lounge]
should read:
[now thread B is sent into an 'object lock not available' lounge]

Anonymous 
Printed Page 525
The "return counter" box - top right of page

The semicolon (";") which should be in the "return counter" box is actually in the "counter += add;" box.

Anonymous 
Printed Page 533
HashMap

"Let's..."
should be:
"Lets..."

Anonymous 
Printed Page 537, 546
In the getSongs() method, the first line in the try block

File file = new File("SongList.txt");
should be as follows:
File file = new File("SongListMore.txt");

Anonymous 
Printed Page 542
1st paragraph

Two errors:
1) "They" should be "The" in the second sentence.
2) "3)" should be "2)" on the second bullet.

Anonymous 
Printed Page 554
main method

new SortMountain
should be:
new SortMountains
The answer page (p 577) for this exercise has the same error.

Anonymous 
Printed Page 585
2nd bullet

The second bullet contains a superfluous "a". The sentence reads, "Make a text file
named manifest.txt that has a one line:". The "a" before "one" is unnecessary.

Anonymous 
Printed Page 586
Answer to first Question

The last sentence of the first Answer should end in a period
instead of a question mark: "... even then the JVM looks only
in the directories that match the package statement."

Anonymous 
Printed Page 591
Paragraph 3

The end of the paragraph is obscured by the graphic.

Anonymous 
Printed Page 591
+3 (last sentence obscured by graphic)

Compiling with -d tells the compiler to not just <i>put</i> your classes into
correct directory tree, but to the directories if they don't...
->
Compiling with -d tells the compiler to not just <i>put</i> your classes into
the correct directory tree, but to <i>build</i> the directories if they don't exist.

########################################

Anonymous  Feb 2007
Printed Page 593
2nd bullet

"... you'll see the META-INF directory and the com directory directory in your current directory"
Remove extra directory after "the com"

Anonymous 
Printed Page 599
First sentence

Sentence should read, "To make a Java Web Start app, you need to create a .jnlp (Java
Network Launch Protocol) file ..."

Anonymous 
Printed Page 669
2nd line,

"mor" should be "more"

Anonymous