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

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

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

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

2n
->
2^n

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

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

2n
->
2^n

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

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

"flags & ~f;"

now reads:

"flags &= ~f;"

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

"flags & ~f;"

now reads:

"flags &= ~f;"

Anonymous  May 2008
Printed Page 78
middle of the page

"commpile-time error"

now reads:

"compile-time error"

Anonymous  May 2008
Other Digital Version 78
middle of the page

"commpile-time error"

now reads:

"compile-time error"

Anonymous  May 2008
Printed Page 89
+3

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

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

Anonymous  Nov 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 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 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 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 2008
Printed Page 219
lines 13 and 14 of monthlyPayment(...) method

The corrected version follows:

// Compute monthly interest payments on a loan
public static BigDecimal monthlyPayment(int amount, // amount of loan
int years, // term in years
double apr) // annual interest %
{
// BigDecimal can compute arbitrary precision results.
// But this causes problems with repeating decimals on division,
// and can take a long time for exponentiation. So we use a
// MathContext to specify how much precision we want
MathContext c = MathContext.DECIMAL128;

// Convert the loan amount to a BigDecimal
BigDecimal principal = new BigDecimal(amount);

// Convert term of loan in years to number of monthly payments
int payments=years*12;

// Convert interest from annual percent to a monthly decimal
BigDecimal interest = BigDecimal.valueOf(apr);
interest = interest.divide(new BigDecimal(100)); // as fraction
interest = interest.divide(new BigDecimal(12), c); // monthly

// The monthly payment computation
BigDecimal x = interest.add(BigDecimal.ONE).pow(payments, c);

BigDecimal y = principal.multiply(interest).multiply(x);
BigDecimal monthly = y.divide(x.subtract(BigDecimal.ONE), c);

// Convert to two decimal places
monthly = monthly.setScale(2, RoundingMode.HALF_EVEN);

return monthly;
}

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

Anonymous  Nov 2006
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 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 2008
Printed Page 250
+1, last full line

from the threads computations
->
from the threads' computations

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

Anonymous  Nov 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 2006
Printed Page 313
+2

@returns
->
@return

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

Anonymous  Nov 2006
Printed Page 313
3rd paragraph

"such as such as"

now reads:

"such as"


Anonymous  May 2008
Other Digital Version 313
3rd paragraph

"such as such as"

now reads:

"such as"


Anonymous  May 2008
Printed Page 336
bottom

"supercede"

now reads

"supersede"

Anonymous  May 2008
Other Digital Version 336
bottom

"supercede"

now reads

"supersede"

Anonymous  May 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 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 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 2006
Printed Page 447
5th line from bottom

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

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

Anonymous  Nov 2006
Printed Page 462
-2

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

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

Anonymous  Nov 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 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 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 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 2008
Printed Page 882
line 5 of Level paragraph

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

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

Anonymous  Nov 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 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 2008
Printed Page 1037
2nd paragraph, 2nd sentence

"the a name-to-value mapping"

now reads:

"the name-to-value mapping"

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

"the a name-to-value mapping"

now reads:

"the name-to-value mapping"

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

verion "1.0"

now reads:

version "1.0"

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

"calling its getDOMImplementation() object"

now reads:

"calling its getDOMImplementation() method."

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

verion "1.0"

now reads:

version "1.0"

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

"calling its getDOMImplementation() object"

now reads:

"calling its getDOMImplementation() method."

Anonymous  May 2008
Printed Page 1091
Right margin of the page

Mysterious missing "Class Index" margin tab.

Anonymous 
Printed Page 1162
"Covariant returns" index entry

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

Anonymous 
Printed Page 1210
Serializable interface (index entry)

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

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

Anonymous  Mar 2007


"...this book was a tremendous help when I first started using Java and continues to be an outstanding reference as I become more experienced in Java."
--Dave Fecak, Philadelphia Area Java Users' Group