Errata (third edition)

(Errata for the second edition are here.)

Chapter 2

page 23, third bullet point:

"The total field stores a record of the total amount of money inserted into the machine by all users since the machine object was constructed."
should read
"The total field stores...since the machine object was constructed, excluding the current balance."

Chapter 3:

Page 78, Exercise 3.39:

"Set a breakpoint in the first line of the sendMessage method..."
should read
"Set a breakpoint in the first line of the sendMailItem method..."

Chapter 4

page 91, paragraph 4, line 1:

"the variable notes is set to hold..."
should read
"the variable note is set to hold..."

page 95, last paragraph, line 1:

"...we first use the Iterator method..."
should read
"...we first use the iterator method..."

Chapter 5

page 129, Exercise 5.7:

The last part of this exercise ("What does the documentation say about control characters...") is now very hard, since the documentation has been changed since Java version 5. It does not explicitly talk about control characters anymore, but about unicode values. The purpose of this exercise was just to get students to look up a technical detail in some documentation. So this could be replaces with, for example, "What will be returned if the string does not contain any whitespace characters?"

page 140, line 1:

"private HashMap responseMap<String, String>;"
should read
"private HashMap<String, String> responseMap;"

Chapter 12

page 386 (Code 12.18), 12 lines up from the bottom:

should read

Chapter 14

(in the project code from the book CD only, not in the text:)

In project taxi-company-later-stage, in class TaxiCompany, method scheduleVehicle:

There is a cast in the source code that is not needed. Instead of

Vehicle vehicle = (Vehicle);

the code should read

Vehicle vehicle =;

Note: this does not cause an error. The code will run, but the cast is superfluous.

Appendix D1

The Appendix states that operators on the same precedence level are evaluated left to right. That is false for unary operators, which evaluate right to left.

In the codepad:

int x = -1;
- ~x; // two unary operators == 0
-(~x); // right to left equivalent == 0
~(-x); // left to right == -2


Back to main page