book.html | TOC | CD-ROM | References | Errata | Tutorial Trail Map

Errata (second edition)

The following is a summary of the errors and ommissions that have been found in the first printing of the second edition of The Java Tutorial. If you find any that aren't listed here, please send them to tutorial@java.sun.com.

Page 50 -- Running the countChars Method
The code shown on this page has a typo. The 'S' on System.err should be capitalized. To compile the program change this line:
system.err.println("Usage: Count filename");
to this:
System.err.println("Usage: Count filename");

Page 51 -- Data Types
Fourth sentence should read "Integers can contain only integral values..."

Page 52 -- Table 1: Java's primitive data types
"Whole numbers" should be "Integers" instead. Likewise in the second sentence in the paragraph following the table.

Page 53 -- Variable Names
List item "1" incorrectly refers to the Russian alphabet. It should refer instead to the Cyrillic alphabet.

Page 54 -- Figure 11
Figure 11 has a typo. The label "Member Parameter Scope" should read "Method Parameter Scope".

Page 67 -- Paragraph Below "By Convention" note.
The reference to the table "Operator Precedence in Java (page 932)" should actually reference page 930.

Page 74 -- Branching Statements
The discussion about labeled break is incorrect. The labeled break statement breaks to the statement following the labeled statement, not to the label as stated.

Page 75 -- Branching Statements
The following sentence at the end of the third paragraph is incorrect and should be removed: "The loop either continues or not depending on the results of the termination condition."

Page 75 -- Branching Statements
The first paragraph about the labeled continue statement needs to be clarified. It should read "The labeled form of the continue statement continues at the next iteration of the labeled loop."

Page 78 -- Code Sample at Top of Page
The code sample found at the top of the page has the same problem as the code on page 50. Additionally, part of the paragraph following the code sample at the top of the page reads "so main doesn't have do". It should read "so main doesn't have to".

Page 85 -- Code Sample at Top of Page
The declaration for the area method is wrong. It should read:
public int area() { 
That is, the int x, int y parameters should be removed.

Page 96 -- implements Interfaces paragraph
The second sentence of the paragraph reads "applet implements and interface". It should read "applet implements an interface".

Page 100 -- static Paragraph
The first sentence refers to members. It should refer to variables to make it more precise.

Page 125 -- Second bullet item
The fourth line reads "confusion to other reading your code." It should read "confusion to others reading your code."

Page 138 -- Being a Descendent of Object
The hashCode method is incorrectly listed as final. hashCode is not final and may be overridden by subclasses.

Page 146 -- Paragraph below first code sample
The second sentence of the paragraph begins "After a specified a mount of time". It should read "After a specified amount of time".

Page 154 -- Inner Classes
In the first code sample after the first paragraph in the section public is misspelled as pubilc.

Page 156 -- Code Sample at the Top of Page
The return statement is wrong. It should read:
return new Enumeration () {
That is, add the parentheses after Enumeration as shown.

Page 161 -- Managing Source and Class Files
The second paragraph in the section has an extra period '.' after the filename Rectangle.java.

Page 162 -- Figure 28 and 29
The first line in Figures 28 and 29 should read "package com.taranis.graphics;" instead of "package.com.taranis.graphics;".  Remove the extra "dot".

Page 171 -- Taking Advantage of the Applet API
In the middle of the page a line reads "about how t o use the". It should read "about how to use the".  There is an extra space.

Page 229 -- The Window at the Bottom of the Page
The bottom two lines in the window should read:
Sent: Hi, PC
Received: Hi, Sun

Page 274 -- Code Sample in Impurity Alert Note
The code incorrectly uses == when it should call the equals method instead:
// IMPURE CODE!
if (System.getProperty("os.name").equals("Solaris"))
  doSomething();
else if (System.getProperty("os.name").equals("Windows 95"))
  doSomethingElse();

Page 303 -- First Paragraph after Code Sample
The paragraph incorrectly refers to getLine. It should refer instead to getWord.

Page 338 -- Code Sample at Top of Page
The code sample misspells Thread twice on the second line.

Page 339 -- Code Sample in Middle of Page
The code sample misspells Thread once on the second line.

Page 386 -- The Second read Method in CheckedInputStream class
This line
cksum.update(b, 0, b.length);
should read like this
cksum.update(b, 0, len);

Page 389 -- How to Write to an ObjectOutputStream
The second line of the code sample in this section has a typo. The bold text
ObjectOutputStream s = new ObjectOutputStream(f);
should be changed as indicated:
ObjectOutputStream s = new ObjectOutputStream(out);

Page 685 -- Code Sample at Bottom of Page
Change this line
thisThread.sleep(interval);
to
Thread.sleep(interval);
The sleep method is a class method that puts the current thread to sleep. Calling it on a specific thread is misleading.

Page 686 -- Code Sample at Top of Page
Change this line
thisThread.sleep(interval);
to
Thread.sleep(interval);
The sleep method is a class method that puts the current thread to sleep. Calling it on a specific thread is misleading.

Page 687 -- Code Sample in Middle of Page
Change this line
Thread.currentThread().sleep(interval);
to
Thread.sleep(interval);
The sleep method is a class method that puts the current thread to sleep. Calling it on a specific thread is misleading.


book.html | TOC | CD-ROM | References | Errata | Tutorial Trail Map