Alice in Action with Java: Errata

Alice in Action with Java: Errata

This page lists corrections for chapters 7-14 of Alice in Action with Java.

For chapters 1-6, please see the errata page of Alice in Action.

Page Description
ix, x Each of the page numbers given for Chapters 8 and 9 are 2 pages off (e.g., Chapter 8 begins on 247, not 245; Section 8.1 begins on 248, not 246; etc.)
267 At the bottom of the page, replace "beginning of Section 8.2" with "end of Section 8.1"
571 On line 5 of Section B.1, insert an open-parenthesis ( before the word "exactly"
ix, 293 Chapter 9 should be titled "Java Methods", not "Methods"
304, 305, 306 The word "reuseable" should be spelled "reusable"
391 In the code fragment under Multiple catch Blocks, the variables inFileName, outFileName, and fout should all be declared before the try block, and initialized to the empty string ("") and null, as follows:
  public static void main(String[]args)
      String inFileName = "";
      String outFileName = "";
      PrintWriter fout = null;
To be consistent, the variable fin should probably also be declared and initialized there, though this is not required for the example to compile and run correctly.

The following is not an error, but an answer to an occaisionally asked question: If you are using Eclipse 3.1, trying to compile the first program (p. 227) may generate this error message:

The method printf(String, Object[]) in the type PrintStream is not 
applicable for the arguments (String, double, double)
The problem is that the printf() method was first supported in Java 1.5, and this version of Eclipse is not using a Java 1.5 compliant compiler by default.

To fix the problem, just look through Eclipse's menus until you find the Preferences (they seem to be in different places on different platforms), then choose Java > Compiler, and you will see a combo box labeled "compiler compliance level". Set this value to at least 1.5, and that should fix the problem.

CS > Alice > Books > Alice in Action with Java > Errata

This page maintained by Joel Adams.