CS1620 Summer I 1998
Errors in the text
There are various typographical errors in the course textbook,
Java Software Solutions: Foundations of Program Design,
by J. Lewis and W. Loftus. This is a collection made by the University
of Toronto
- On page 111, in the seventh line from the bottom, "stdn"
should be "stdin".
- In the code for Section 4.7's "CD collection" example on page 148,
two decimal points have mysteriously become commas. The fifth line of
code should be:
CD_Collection music = new CD_Collection (5, 59.69);
And the eighth line should be:
music.add_cds (2, 24.73);
- In Figure 5.3, on page 174, the last bit of the binary representation
of -347 should be 1, not 0. (Thanks to Nick Hozjan reporting for this error.)
- In Figure 5.12 on page 185, the last entry in the last row
should be "true", not "false", because true && true
has the value true.
-
On page 212, the loop printing the "Numbers in reverse" is missing a minus
sign before the final parenthesis (reported by Alice Chan):
for (int index = numbers.length-1; index >= 0; index--)
^
-
On page 289, the second-last line of the second paragraph should say, "...are
invoked through the Dictionary object called webster",
rather than "...the Book object..." (reported by Andria Hunter).
- On page 344, the header for class Print_Logger should say:
// Prints to stdout ...
(and not "Prints to sdtin[sic]...").
(It's not often you'll see "[sic]" in errata!)
- On page 363, the entire chunk of code in the middle of the page
(between Figure 10.4 and Figure 10.5) should not be there. It's just
a repetition of code in the middle of the previous page.
Also on page 363, in Figure 10.5, the labels on the arrows numbered
3 and 5 are wrong. They should be "3:get_quote()" and "5:update_label()".
-
On pages 371-2, and in a reference on page 403, the methods
minimumSize() and preferredSize() should not be
used. They work, but they are "deprecated" -- that is, a newer
method is considered preferable. In this case, the methods that
should be used are
getMinimumSize() and getPreferredSize().
-
In Figure 10.13, on page 379, the description of radio buttons should be
something like "a set of buttons such that exactly one of the buttons
can be in the 'on' or 'pushed' state" -- rather than the current
description, which seems to be a copy of the one for the "Choice button".
-
In Figure 13.3, on page 476, the second-last paragraph should
say "5 is greater than 3" (and not "5 is not greater than 3").
-
In Appendix O's description of StringTokenizer, on page 806, the
description of hasMoreElements() and hasMoreTokens() should say,
"hasMoreElements()is identical to hasMoreTokens()"
(rather than "...identical to nextToken()").