ProgramLive Errata, Edition
2 (June 2001)
The list below contains corrections to edition 2 of ProgramLive,
which was produced in June 2001.
Glossary
-
Item "Lesson". It refers to Lesson 1-1; it should be Lesson 0-1.
-
Item "try-statement". The description of a catch-clause
is wrong. It should be:
catch ( <parameter declaration>
) <catch-block>
where the type of the parameter is (a subclass of)
class Throwable.
Lesson 1, Intro to Java
-
Activity 1-3-6 says that "4.0, 10.0,
and 2.1 are not integers. Instead, they are
constants of primitive type float, not int." This is wrong;
they are constants of type double.
Lesson 2, Methods and method calls
Lesson 3, Classes
Lesson 4, Subclasses and inheritance
-
Lab PGL-3 (Drawing frames II). Method proc should not be in the objects
of class C that appear in this lab because method proc is static. Also,
in step 2, sentence "This should cause you to execute ...", the call that
will be executed is D(cvar.d, 3), not D(cvar.a, 3).
Lesson 5, Some useful classses
-
Activity 5-7-5, Reading a file. The first statement that appears in the
monitor window, to create BufferedReader fr, is incorrect. The correct
statement does appear in the exposition text.
Lesson 6, Primitive types
Lesson 7, Loops
Lesson 8, Arrays
-
Activity 8-2-2, Picturing array segments. In the Windows (not the Macintosh)
version, there is a missing right boundary for the segment b[i..i] slightly
more than halfway through the activity, when the reader says, "As a final
example, ...".
-
Activity 8-3-2, footnote. The third schema should
not have int after for.
-
Activity 8-5-2, Another version of linear search.
This is not a mistake but an extension. We could show the following for-loop
version:
int i;
// {inv P: (1) h <= i <= k and (2) x not
in b[h..i-1]}
for (i = h; i != k && x
!= b[i]; i++) ; //empty body!
return i;
-
Activity 8-5-5, Merging two sorted array segments.
Class UpdatingArrays was mistakenly placed in file UpdateArray.java; it
won't compile properly until the file name is changed.
Lesson 9, Multidimensional arrays
Lesson 10, Exception handling
Lesson 11, Packages
Lesson 12, Interfaces
-
Lesson page 12-3. Throughout, it says that the parameter
of method compareTo should be of type Comparable; it should be of type
Object, in order to be compatible with interface java.util.Comparable.
-
Activity 12-3.2, Casting between Pixel and Comparable.
The speaker's voice is cut off too soon at the first pause.
Lesson 13, Programming style
Lesson 14, Testing and debugging
Lesson 15, Recursion
-
Activity 15-4-1. The exposition text is missing a
call on method partition in two places; the exposition itself is correct.
Lesson 16, Applets,
Lesson 17, GUIs and event-driven programming
Lesson 18, The CodeWarrior IDE for
Java
-
Lesson page 18-1, CodeWarrior for Java, the penultimate footenote on downloading
the API specs, just before section "For Macintosh users". Change
the parenthesized phrase to: (and a computer with a big hard disk).
-
Activity 18-7-1, Setting, removing, and using breakpoints. The variables
pane is not updated correctly when stepping into function f. Also, on return
from the first call, the program-counter arrow is a the wrong place.