Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

Head First Java, 2nd Edition

by Kathy Sierra, Bert Bates

This errata page lists errors outstanding in the most recent printing.

If you have technical questions or error reports, you can send them to
booktech@oreilly.com. Please specify the printing date of your copy.

This page was updated August 9, 2006.

Here's a key to the markup:


[page-number]: serious technical mistake
{page-number}: minor technical mistake
<page-number>: important language/formatting problem
(page-number): language change or minor formatting problem
?page-number?: reader question or request for clarification

Confirmed errors:

(xxx) 2nd paragraph;


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

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

{6} hand-written text after "System.out.print("Dog: " + name);;


Sentence reads,

print out "Hello Fido"...

Should read,

print out "Dog: Fido"...

(10) Bullet 2 "do something again and again";


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

(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");

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

(68) Solution to "Be The Compiler" exercise B;


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

(99) "real code" paragraph;


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

(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.

{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>.)

(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).

(150) Code line: "public void setName...";


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

(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..."
(154, 155, 157) References to "chapter 16";
All references to chapter 16 on these pages should be references to chapter 17.

(180) Note at end of page;


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

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

(195) Mixed messages answer;


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

(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.

(245) 3rd paragraph;


"clunkly" should read "clunky"

(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.

(260) 1st paragraph;


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

"primtives" should read "primitives"

{266} doStuff2 method;


The statement
GC localGC
must end in a semicolon.

{275} 1st column, regular (non-static) method;


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

(360) Getting a button's ActionEvent #3;


Change:
"...method from the ActionListener interrface"
To:
"...method from the ActionListener interface"
{370} in the note on the left; 2nd paragraph
regsion
should be:
region

(392) Sharpen your pencil;


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

<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/hfjava2/HFJava_393_396.pdf

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

(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.

(422) third handwritten comment from the bottom;


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

(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.

(459) Make it Stick;


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

(463) Last two lines of code;


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

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

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

(507) in function "public void run ()";


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

(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]

(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.

(533) HashMap;
"Let's..."
should be:
"Lets..."

{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");

(542) 1st paragraph;


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

{554} main method;


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

(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.

(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."
(591) Paragraph 3;
The end of the paragraph is obscured by the graphic.

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

(599) First sentence;


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

(669) 2nd line,


"mor" should be "more"

You might also like