Errata (third edition)
(Errata for the second edition are
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."
"The total field stores...since the machine
object was constructed, excluding the current balance."
Page 78, Exercise 3.39:
"Set a breakpoint in the first line of the sendMessage method..."
"Set a breakpoint in the first line of the sendMailItem method..."
page 91, paragraph 4, line 1:
"the variable notes is set to hold..."
"the variable note is set to hold..."
page 95, last paragraph, line 1:
"...we first use the Iterator method..."
"...we first use the iterator method..."
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>;"
"private HashMap<String, String> responseMap;"
page 386 (Code 12.18), 12 lines up from
(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) it.next();
the code should read
Vehicle vehicle = it.next();
Note: this does not
cause an error. The code will run, but the cast is superfluous.
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