Errata

Java in a Nutshell

Errata for Java in a Nutshell, Fifth Edition

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

primitive types as secribed in
->
primitive types as described in

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

Anonymous    Nov 01, 2006
Printed
Page 38
Left shift (<<), line 4

2n
->
2^n

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

Anonymous    Nov 01, 2006
Printed
Page 38
Signed right shift (>>), last line

2n
->
2^n

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

Anonymous    Nov 01, 2006
Printed
Page 39
End of "Assignment Operators" section

"flags & ~f;"

now reads:

"flags &= ~f;"

Anonymous    May 01, 2008
Other Digital Version
39
End of "Assignment Operators" section

"flags & ~f;"

now reads:

"flags &= ~f;"

Anonymous    May 01, 2008
Printed
Page 78
middle of the page

"commpile-time error"

now reads:

"compile-time error"

Anonymous    May 01, 2008
Other Digital Version
78
middle of the page

"commpile-time error"

now reads:

"compile-time error"

Anonymous    May 01, 2008
Printed
Page 89
+3

make it much simple to use
->
make it much simpler to use

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

Anonymous    Nov 01, 2006
Printed
Page 101
Code block two

The declaration omits a type,

"public static final DAYS_PER_WEEK = 7;"

now reads:

"public static final int DAYS_PER_WEEK = 7;"

Anonymous    May 01, 2008
Other Digital Version
101
Code block two

The declaration omits a type,

"public static final DAYS_PER_WEEK = 7;"

now reads:

"public static final int DAYS_PER_WEEK = 7;"

Anonymous    May 01, 2008
Printed
Page 132
Example 3-6, comparreTo method

The comment about long/integer arithmetic in the method body is correct, but
the code does not perform long arithmetic.

There are three subtractions, each of which are done on integer
values and thus will overflow for a large positive value minus a very negative
value or vice versa. (The assignment to a long is a widening conversion
(pp 26-27) but the widening conversion is not applied to the subexpressions.

long result = that.y - this.y; // Smaller circles have bigger y values
if (result == 0) result = this.x - that.x; // If same compare l-to-r
if (result == 0) result = this.r - that.r; // If same compare radius

now reads:

long result = (long)that.y-this.y; // Smaller circles have bigger y
if (result==0) result = (long)this.x-that.x; // If same compare l-to-r
if (result==0) result = (long)this.r-that.r; // If same compare radius


Anonymous    May 01, 2008
Other Digital Version
132
Example 3-6, comparreTo method

The comment about long/integer arithmetic in the method body is correct, but
the code does not perform long arithmetic.

There are three subtractions, each of which are done on integer
values and thus will overflow for a large positive value minus a very negative
value or vice versa. (The assignment to a long is a widening conversion
(pp 26-27) but the widening conversion is not applied to the subexpressions.

long result = that.y - this.y; // Smaller circles have bigger y values
if (result == 0) result = this.x - that.x; // If same compare l-to-r
if (result == 0) result = this.r - that.r; // If same compare radius

now reads:

long result = (long)that.y-this.y; // Smaller circles have bigger y
if (result==0) result = (long)this.x-that.x; // If same compare l-to-r
if (result==0) result = (long)this.r-that.r; // If same compare radius


Anonymous    May 01, 2008
Printed
Page 235
2nd paragraph from bottom

"The head of a PriorityQueue is always the the smallest element"

now reads:

"The head of a PriorityQueue is always the smallest element"

Anonymous    May 01, 2008
Other Digital Version
235
2nd paragraph from bottom

"The head of a PriorityQueue is always the the smallest element"

now reads:

"The head of a PriorityQueue is always the smallest element"

Anonymous    May 01, 2008
Printed
Page 250
+1, last full line

from the threads computations
->
from the threads' computations

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

Anonymous    Nov 01, 2006
Printed
Page 289
center of page

String filepass = "KeyStore password" // Password for entire file.
->
String filepass = "KeyStore password"; // Password for entire file.

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

Anonymous    Nov 01, 2006
Printed
Page 313
+2

@returns
->
@return

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

Anonymous    Nov 01, 2006
Printed
Page 313
3rd paragraph

"such as such as"

now reads:

"such as"


Anonymous    May 01, 2008
Other Digital Version
313
3rd paragraph

"such as such as"

now reads:

"such as"


Anonymous    May 01, 2008
Printed
Page 336
bottom

"supercede"

now reads

"supersede"

Anonymous    May 01, 2008
Other Digital Version
336
bottom

"supercede"

now reads

"supersede"

Anonymous    May 01, 2008
Printed
Page 341
top

-Xmaxerrors through -Xswitchcheck are now outdented one level so that they're at the same level as -Xlint.

Anonymous    May 01, 2008
Other Digital Version
341
top

-Xmaxerrors through -Xswitchcheck are now outdented one level so that they're at the same level as -Xlint.

Anonymous    May 01, 2008
Printed
Page 397
-1

file creation methods have were added in Java 1.2.
->
file creation methods were added in Java 1.2.

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

Anonymous    Nov 01, 2006
Printed
Page 447
5th line from bottom

public float floatValue();yu
->
public float floatValue();

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

Anonymous    Nov 01, 2006
Printed
Page 462
-2

returning a the wrapped double value
->
returning a wrapped double value

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

Anonymous    Nov 01, 2006
Printed
Page 462
Deprecated entry

Under the horizontal rule is @Retention(RUNTIME), but in the last paragraph about Deprecated, the text says
has source retention.

"This annotation type has source retention"

now reads:

"This annotation type has runtime retention."

Anonymous    May 01, 2008
Other Digital Version
462
Deprecated entry

Under the horizontal rule is @Retention(RUNTIME), but in the last paragraph about Deprecated, the text says
has source retention.

"This annotation type has source retention"

now reads:

"This annotation type has runtime retention."

Anonymous    May 01, 2008
Printed
Page 488
Class Short, 1st sentence

"This class provides an object wrapper around the short primitive type."

now reads:

"This class provides an immutable object wrapper around the short primitive type."

Anonymous    May 01, 2008
Other Digital Version
488
Class Short, 1st sentence

"This class provides an object wrapper around the short primitive type."

now reads:

"This class provides an immutable object wrapper around the short primitive type."

Anonymous    May 01, 2008
Printed
Page 882
line 5 of Level paragraph

The constant ALL enable logging
->
The constant ALL enables logging

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

Anonymous    Nov 01, 2006
Printed
Page 1022
1st paragraph of the SchemaFactory entry

Changed "URL" to "URI" in the two places it appears in this paragraph.

Anonymous    May 01, 2008
Other Digital Version
1022
1st paragraph of the SchemaFactory entry

Changed "URL" to "URI" in the two places it appears in this paragraph.

Anonymous    May 01, 2008
Printed
Page 1037
2nd paragraph, 2nd sentence

"the a name-to-value mapping"

now reads:

"the name-to-value mapping"

Anonymous    May 01, 2008
Other Digital Version
1037
2nd paragraph, 2nd sentence

"the a name-to-value mapping"

now reads:

"the name-to-value mapping"

Anonymous    May 01, 2008
Printed
Page 1040
2nd paragraph, 2nd sentence

verion "1.0"

now reads:

version "1.0"

Anonymous    May 01, 2008
Printed
Page 1040
3rd paragraph, 1st sentence

"calling its getDOMImplementation() object"

now reads:

"calling its getDOMImplementation() method."

Anonymous    May 01, 2008
Other Digital Version
1040
2nd paragraph, 2nd sentence

verion "1.0"

now reads:

version "1.0"

Anonymous    May 01, 2008
Other Digital Version
1040
3rd paragraph, 1st sentence

"calling its getDOMImplementation() object"

now reads:

"calling its getDOMImplementation() method."

Anonymous    May 01, 2008
Printed
Page 1162
"Covariant returns" index entry

Missing reference to page 70 (section "Covariant return types")

Anonymous    Jul 22, 2011
Printed
Page 1210
Serializable interface (index entry)

Serializable interface, 139, 432
->
Serializable interface, 139, 431

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

Anonymous    Mar 01, 2007