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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.


Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question



Version Location Description Submitted By
Printed Page 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

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 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..."

Anonymous 
Printed Page 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;
}
}
}

Anonymous 
Printed Page 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;
}
}

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

Anonymous 
Printed Page 200
3rd paragraph

First Edition:
Page 200:
3rd Paragraph:
In discussion of "you must implement abstract methods"

Text currently reads:

"But remember that an abstract class can have both abstract and non-abstract methods, so Canine, for example, could implement an abstract class from Animal,..."

But I think it should read:

"But remember that an abstract class can have both abstract and non-abstract methods, so Canine, for example, could implement an abstract method from Animal,..."

***********************************************

Also:

Somewhere earlier in the text, (before page 200),
I thought I saw an occurrence of "Infact" which should
probably be "In fact" but I cannot find it now.
Perhaps you can find it easily in the digital copy
on the computer using the 'Find' feature (which, for some
reason, does not operate well on the printed copy).

***********************************************

Thanks for the entertainment. The "Head First" series are
much more fun to read than most typical technical books,
which have a tendency to be dry, boring and sleepy.

Anonymous 
Printed Page 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

Anonymous 
Printed Page 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();

Anonymous 
Printed Page 378
Pool Puzzle, in MyDrawP class

public void paintComponent(
(Graphics ________) {

should read:
public void paintComponent //there was an extra parenthesis
(Graphics ________) {

Anonymous 
Printed Page 386
pulbic void go()

Add this line:

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Anonymous 
Printed Page 387
pulbic void go()

Add this line:

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Anonymous 
Printed Page 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

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 449
DungeonTest code

Should include "import.java.io.*;" just above "class DungeonTest".

Anonymous 
Printed Page 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)

Anonymous 
Printed Page 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.

Anonymous