Errata

Java Language Reference

Errata for Java Language Reference

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 1
-- { --+--+--+- case - Expression-:-+--+-----------------------+--+-}|

| | | | | |
| | _ | +-- Statement -------------+
| +--/1-- default ------+ | |
| | +LocalVariableDeclaration-;+
+--------------<----------+ | |
+- LocalClassDeclaration --+
| |
+----------------<---------+

Anonymous   
Printed
Page 20

Now reads:

|--- " --- AnyCharacterButApostropheOrBackSlash --- " ---|

Should Read:
|--- " --- AnyCharacterButDoubleQuotetOrBackSlash --- " ---|

Anonymous   
Printed
Page 29
last 4 lines of the page

"Normally, non-zero float values are represented as:

sign*mantissa*2^exponent

where sign is +1 or -1, mantissa is a positive integer less than 2**24
and exponent is an integer in the inclusive range -149 to 104."

changed to

"Normally, non-zero float values are represented as:

sign*mantissa*2^exponent-23

where sign is +1 or -1, mantissa is a positive integer less than 2^24
and exponent is an integer in the inclusive range -126 to 127."

(the ^ indicates superscript. In other words, "exponent-23" appears in
superscript.)

Anonymous    Jan 01, 1998
Printed
Page 30
In lines 1-4

"Non-zero double values are represented as:

sign*mantissa*2^exponent

where sign is +1 or -1, mantissa is a positive integer less than 2^53
and exponent is an integer in the inclusive range -1045 to 1000."

Changed to:

"Non-zero double values are represented as:

sign*mantissa*2^exponent-52

where sign is +1 or -1, mantissa is a positive integer less than 2^53
and exponent is an integer in the inclusive range -1022 to 1023."

(the ^ indicates superscript. In other words, "exponent-52" appears in
superscript.)

Anonymous    Jan 01, 1998
Printed
Page 34
In line 4: swapped "s" and "t"

Anonymous    Jan 01, 1998
Printed
Page 40
the railroad diagram should not indicate that the word "super" is a

term, since "super", by itself, is not a valid expression.

Anonymous   
Printed
Page 44
the diagram for Field expression should be

|--+-------------------------------------------+--- Identifier ---+---|
| | |
+---------- super ----------------+ | |
| | | |
+-- PrimaryExpression --------+---+--- . ---+ |
| | |
+-- ClassOrInterfaceName --+--+ |
| |
+--- . ---- this -------------------+

Anonymous   
Printed
Page 48
There is an error in the railroad diagram for method call

expression. The problem can be fixed by simplifying the diagram:

|--- FieldExpression ---- ( --- ArgumentList --- ) ---|

Anonymous   
Printed
Page 143
section 5.4.6.3, para. 2, lines 3-4: delete this sentence

"It is also an error to declare a method with the same name as a
variable declared in the same class or any of its superclasses."

Anonymous   
Printed
Page 156

There is an example program "class foo" which reads:


class foo {
static int i = 4;
static {
i += 2;
j = 5 * i; // forward reference to j
}
static int j = 7; // deklaration of j
static double d;
static frame f = new Frame(); // frame should be Frame
static { d = Math.tan(Math.PI / j); }
}

In the following two paragraphs this example is explained to be
correct, especially the forward reference to the variable j, made
in the static initializer preceeding the variable declaration.

When you compile this, with both JDK 1.1.6 and JDK 1.2,
both versions of the compiler says:

Can't make forward reference to j in class foo.
j = 5 * i;
^
1 error

The specifications for Java said this should be okay, and I believe it
used to work with an earlier release, possibly the 1.1 beta. But the
specifications were changed just before 1.1 was released. Please
disregard this section on forward references. It will be removed from
future editions.

Anonymous   
Printed
Page 181
the railroad diagram for switch statement is incorrect: the problem

is that the contents of a switch block must begin with a switch label and
the railroad diagram does not reflect that requirement.

Here's an ASCII version of the corrected diagram:


|
+---- switch ------ ( --- identifier --- ) ------------------(1)
|

+---------------------------<-----------------------------+
| | |

Anonymous   
Printed
Page 382
Under "public void checkwrite(string file)", "throws securityException",

you write "If the caller does not have permission to 'read from' the named
file ...", but the actual description & method name contradict this.

Anonymous   
Printed
Page 477
Added the following to the last para.

"Whenever possible, our books use RepKover (tm), a durable and flexible
lay-flat binding. If the page count exceeds RepKover's limit, perfect
binding is used."

Anonymous    Jan 01, 1998