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 11
4th paragraph

The word 'runtime' is broken at the end of the line as 'runt-ime';
it should be broken 'run-time'

Anonymous 
Printed Page 39
10th line from Bottom

A method or variable declared as private is only inaccessible from inside its own class.

NOW READS:
A method or variable declared as private is only accessible from inside its own class.

Anonymous  Feb 2004
Printed Page 43
1st and 3rd paragraphs

In the first paragraph, the line that says
'HelloJava2 newobj = new HelloComponent2("Hello Java!");

It should say
'HelloComponent2 newobj = new HelloComponent2("Hello Java!");'

There is a similar error in the third paragraph.

Anonymous 
Printed Page 67
5th paragraph (just before "System Properties" heading)

Missing space before "method" in "The java interpreter continues to run until the
main()method of the initial class file returns..."

Anonymous 
Printed Page 77
output for "jar tvf spaceblaster.jar"

The first line of the output is incorrectly indented, so it doesn't line up with the other lines.

Anonymous 
Printed Page 108
near top of page

There should be a semicolon (;) at the end of line for the following code sample

assert a > 0 : a
assert foo != null : "foo is not null!"

Anonymous 
Printed Page 108
last 2 command line examples and last paragraph

The examples should have a class to execute. Instead of

% java -ea:com.oreilly.examples.Myclass

it should be

% java -ea:com.oreilly.examples.Myclass MyApplication

And instead of

% java -ea:com.oreilly.examples...

it should be

% java -ea:com.oreilly.examples... MyApplication

Also, there is a missing "a" before "package" in the last paragraph. Instead of "When
you enable assertions for package, Java also enables all subordinate package
names..." it should be "When you enable assertions for a package, Java also enables
all subordinate package names..."

Anonymous 
Printed Page 109
middle of page

missing semicolon (;) at end of

doRight()

Anonymous 
Printed Page 111
middle of the page, under "Array Types"

"An array of objects can be created in the same way:"

NOW READS:
"An array of objects can be declared in the same way:"

Anonymous  Feb 2004
Printed Page 119
3rd paragraph

The word "zero" is not a keyword or variable, so it shouldn't be set in monospace
font in "...it's given a default value appropriate for its type (null, zero, or false)."

Anonymous 
Printed Page 130
4th paragraph

"We'll talk about method overriding later in the chapter."
should say:
"We'll talk about method overriding in the next chapter"

Anonymous 
Printed Page 133
2nd to last paragraph

"The instance variable defaultDoors is not initialized until a later point in the
chain of constructor calls, ...."

NOW READS:
default_doors, not defaultDoors

Anonymous  Oct 2003
Printed Page 160
3rd paragraph

"the table doesn't addresses that scope"
should read
"the table doesn't address that scope"

Anonymous 
Printed Page 189
1st paragraph

"The magic is performed by slight of hand"

NOW READS:
"The magic is performed by sleight of hand"

Anonymous  Feb 2004
Printed Page 196
2nd paragraph

The text incorrectly refers to an instance method sleep(), when in truth there are only two static sleep() methods.

Anonymous 
Printed Page 196
2nd paragraph

The third and fourth sentences of the second paragraph on p. 196 NOW READ as follows:

For this, we can use the static method Thread.sleep(), which affects
the currently executing thread. The call causes the thread to go idle
for a speciifed number of milliseconds:

Anonymous  Feb 2004
Printed Page 231
IN PRINT: 3rd paragraph, code sample

"String s = Integer.toHexString( 255 ).toUpper(); // s = "FF";"

NOW READS:
"String s = Integer.toHexString( 255 ).toUpperCase(); // s = "FF";"

Anonymous  Oct 2003
Printed Page 232
4th paragraph

(probably typo, but serious error anyway)
text:
You can retrieve the default Locale ... with the static Local.getDefault() method.
should be:
... with the static Locale.getDefault() method.

Anonymous 
Printed Page 235
2nd para, first line of code

NOW READS:
double progress = 0.44;

Anonymous  Feb 2004
Printed Page 258
Table 10-4

In Table 10-4

nextFloat() returns a random float from 0.0 inclusive to 1.0 exclusive, not from -1.0
to 1.0 as listed

nextDouble() returns a random double from 0.0 inclusive to 1.0 exclusive, not from
-1.0 to 1.0 as listed

nextGaussian() should be clarified as returning a Gaussian distributed double value
with mean 0.0 and standard deviation 1.0. Only the standard deviation is mentioned,
and the type returned is not stated.

(At the top of page 259 the appropriate clarifications for nextGaussian() are made.)

Anonymous 
Printed Page 304
last but one paragraph

"the Swing JFileDialog class"
should say:
"the Swing JFileChooser class"

Anonymous 
Printed Page 304
Code sample following the 2nd paragraph

System.getProperty("user.dir"));

NOW READS:
System.getProperty("user.dir");

Anonymous  Oct 2003
Printed Page 305
2nd paragraph under File Options

"...getPath() returns the directory information without the filename."
should be:
"...getPath() returns the directory information and the filename."

Anonymous 
Printed Page 306

Collections.sort(l);
should be
Collections.sort(list);

Anonymous 
Printed Page 307
Table 11-1

The method for creating multiple directories in a path is written as Mkdirs(),
this should be lowercase, mkdirs().

Anonymous 
Printed Page 309
Beginning of 2nd paragraph

Missing space between words:
FileOutputStreamis

NOW READS:
FileOutputStream is

Anonymous  Oct 2003
Printed Page 311
4th paragraph

"In Chapter 11 we'll take a detailed look at building networked applications with
sockets."

NOW READS:
"In Chapter 12 we'll take a detailed look at building networked applications with
sockets."

Anonymous  Feb 2004
Printed Page 322
4th paragraph

The first sentence of paragraph 4:

"The position for reading and writing the Buffer is always greater than the mark,
which serves as a lower bound, and the limit, which serves as an upper bound."

NOW READS:
The position for reading and writing the Buffer is always between the
mark and the limit.

Anonymous  Oct 2003
Printed Page 323
Bottom of page

3rd line from end of page states:
(For example, shorts and floats consume two bytes each, longs and doubles four.)

NOW READS:
(For example, shorts are two bytes, floats are four, longs and doubles are eight.)

Anonymous  Oct 2003
Printed Page 343
2nd paragraph, 1st sentence

First sentence of paragraph under header "Do French web servers speak French?":
BufferedRead

NOW READS:
BufferedReader

Anonymous  Oct 2003
Printed Page 367
1st Paragraph starting with "Finally,"

The following HAS BEEN ADDED in the code section before the line starting with StringIterator:
public MyClient(String host) throws RemoteException {


Anonymous  Feb 2004
Printed Page 370
Third sentence in first paragraph

The text says that "Each call to select() returns the set of SelectionKeys that are
ready for some type of I/O'. This is incorrect. Instead, select() returns the number
of keys which are ready for some type of I/O. The selectedKeys() method returns the
Set of SelectionKeys that are ready for I/O.

Anonymous 
Printed Page 374
8th line in write() method

The test to determine if the file has been completely read is incorrect. It should be
if (got == remaining)
rather than
if (got == -1 || remaining <= 0)

Anonymous 
Printed Page 386

In the Post.java sample, in the line immediately following "// read:

results...";
The if statement immediately following the comment:
...
// read results...
if (urlcon.getResponseCode( ) != HttpURLConnection.HTTP_OK )
...
Based on the logic of the if statement, the test is backward;

NOW READS:
if (urlcon.getResponseCode( ) == HttpURLConnection.HTTP_OK )

Anonymous  Oct 2003
Printed Page 404
8th and 9th code lines from top of page

In the following two lines of code from the ShoppingCart.java sample:
out.println( "<html><head><title>Shopping Cart</title>"
+ "</title></head><body><p>" );

These code lines NOW READ:
out.println( "<html><head><title>Shopping Cart</title>"
+ "</head><body><p>" );

Anonymous  Feb 2004
Printed Page 405
Middle of the 3rd text paragraph

In line 6 of the 3rd paragraph:

... getValue() gives us a null array ...

This should say "getAttribute()", not "getValue()".

Anonymous 
Printed Page 406
Next to last paragraph, last sentence

The text says "Indicating a negative time period is a good way to erase an existing
cookie of the same name". This is incorrect. Indicating a time period of 0 will erase
an existing cookie; indicating a negative time period will not affect existing
cookies of the same name.

Anonymous 
Printed Page 439
3rd paragraph, 3rd sentence

The beginning of this sentence NOW READS:
"JFrame is derived from java.awt.Frame, which is ... "

Anonymous  Feb 2004
Printed Page 502
1st paragraph under "Validating Data"

Where it says
"Java 1.4 added the InputVerifier API"
it should say
"Java 1.3 added the InputVerifier API"
Sun's Javadocs and other resources mention that InputVerifier was added with 1.3.

Anonymous 
Printed Page 506
Figure 17-4

The figure is from Microsoft Internet Explorer for Mac and not the CanisMinor Application.

Anonymous 
Printed Page 682
2nd paragraph

The command
keytool -csr -alias Pat -file Pat.csr -keypass secure -storepass boofa

NOW READS:
keytool -certreq -alias Pat -file Pat.csr -keypass secure -storepass boofa

Anonymous  Oct 2003
Printed Page 692
Public Class SimpleElement

The public method
public void addText(String s) {...
should be
public void setText(String s) {...

Anonymous 
Printed Page 694
public void characters() method

The public void characters() method uses .addText(text);

This should be .setText(text);

Anonymous