Errata 3rd Edition SDK 1.5 Update

[ Home ]General Information ] Student Resources ] [ Site Map ]

There are two errors in this version. One was my fault. Another was due to the change made to the Scanner class after the book went into the production.

Page

Description

109, 110, 111, 112, 113, 117, 122, 253, 338, 711

All sample programs that use the Scanner class include a wrong statement for creating a new instance of the class. In the book, you will the following statement:

scanner = Scanner.create(System.in);

This must be replaced with

scanner = new  Scanner(System.in);

The top statement is how a new Scanner instance was created in the Beta 1 version of SDK 1.5. Sun engineers changed it to the bottom statement with the current Beta 2 version. The 3rd Ed SDK 1.5 Update book was published before this change was made. Please make this one-line replacement in the sample programs listed on the indicated pages. Sample programs you download from this website for the 3rd Ed SDK 1.5 Update include the correct statement.

193

The sample program Ch4TestKennel listed in the book does use the Scanner class. This class needs to be modified to include the Scanner class for handling standard input. Necessary corrections are made in the sample Ch4TestKennel program you can download from this website.