Errata for Java Language Reference

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.

"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

"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)
|
+---------------------------<-----------------------------+
| | |