:
"Christine Byrne" and "Judith Byrne"
to:
"Christina Byrne" and "Judita Byrne"
"Request for Comment" section:
We have a web site for the book, where we'll list examples, errata, and any
plans for future editions. You can access this page at:
For more information about this book and others, see the O'Reilly web site:
"are an server-side" now reads "are a server-side"
The last sentence no longer has "is" and "has" together.
"do any harm: it cannot infect" now reads "do any harm: untrusted code
cannot infect ..."
Cut the sentence "They make this formula ... not just a specific set like:"
and the code line that follows. Join the next paragraph ("A variable in a Java
program...") to the previous paragraph.
***The following error applies only to the 3/01 printing of the book:***
"If you didn't understood all the details..." now reads "If you didn't
understand all the details...".
Unicode character of PI was described:
..., and u3c00 is the character PI.
Now reads:
..., and u03c0 is the character PI.
did read
As shown in Table 2-3,
now reads
As shown in Table 2-2,
second code example; The code reads:
byte sum = (byte) (b1 + b2); // Sum wraps to 128,
which is the smallest byte
It should be changed to read:
byte sum = (byte) (b1 + b2); // Sum wraps to -128,
which is the smallest byte
***The following error applies only to the 3/01 printing of the book:***
All three comments are missing a multiplication sign.
"As shown in table 2-3, float..."
Now reads:
"As shown in table 2-2, float...".
Changed:
byte sum = b1 + b2; // Sum wraps to...
To:
byte sum = (byte)(b1 + b2); // Sum wraps to...
"Avagadro's Number" now reads "Avogadro's Number."
Changed the four lines to read:
double inf = 1.0/0.0; // Infinity
double neginf = -1.0/0.0; // -Infinity
double negzero = -1.0/inf; // Negative zero
double NaN = 0.0/0.0; // Not-a-Number
Also, in the paragraph above these lines of code, changed "such as 0/0" to
"such as 0.0/0.0".
Also, in the last paragraph before the "Strings" heading,
changed the sentence:
1/0 yields positive infinity, but 1 divided by
negative zero yields negative infinity.
To:
1.0/0.0 yields positive infinity, but 1.0 divided by
negative zero yields negative infinity.
Did read:
Float.isNan() and Double.isNan() methods.
Now reads:
Float.isNaN() and Double.isNaN() methods.
"The only way to distinguish negative zero..."
Now reads:
"One way to distinguish negative zero..."
Changed the 2nd sentence of the second paragraph to read:
A widening conversion occurs when a value of one type is converted to
a wider type--one that has a larger range of legal values.
Deleted the 3rd sentence of the 2nd paragraph, which began,
"A narrowing conversion...fewer bits."
And changed the beginning of the 3rd paragraph to read:
Narrowing conversions are another matter, however. A narrowing conversion
occurs when a value is converted to a type that is not wider than it.
Narrowing conversions are not always safe: it is reasonable to convert...
Also, changed "$ndash;128" to "-128"
The following code line:
1.7 // An integer literal
Now reads:
1.7 // A floating-point literal
Changed the last line of this paragraph to read:
"...operands must be convertible to the same type."
The second paragraph of the section "Conditional AND (&&)" reads:
This operator (and all the Boolean operators except the
unary ! operator) have a lower precedence....
HAVE should be HAS.
Did read:
byte b = ~12 //~00000110 ==> 11111001 or -13 decimal
Now reads:
byte b = ~12 //~00001100 ==> 11110011 or -13 decimal
Did read:
10 & 7
Now reads:
10 ^ 7
"the same x=x+2" now reads "the same as x=x+2".
-50 >>> 2 // 11001110 >>> 2 = 00110011 = 51
0xff >>> 4 // 11111111 >>> 4 = 00001111 = 15 = 255/16
now reads
0xff >>> 4 // 11111111 >>> 4 = 00001111 = 15 = 255/16
-50 >>> 2 // 0xFFFFFFCE >>> 2 = 0x3FFFFF33 = 1073741811
Changed the last line of this paragraph to read:
"...of any type, but they must be convertible to the same type."
Changed first sentence to read "In Java, objects (and arrays) are ..."
and finishes on 45:
The code now reads:
for(int i= 0; i < 10; i++) {
a[i]++; // Body of this loop is a compound statement.
b[i]--; // It consists of two expression statements
} // within curly braces.
Note "statement" previously in Line 3 should be the end of Line 2.
did read
[..] that is defined within a method orx compound statement. [..]
now reads
[..] that is defined within a method or compound statement. [..]
"a identifier" now reads "an identifier"
First sentence did read:
"does not allow you to use a variable"
Now reads:
"does not allow you to use a local variable"
The line did read:
int j = 0; // Declare j; i and j are in scope here
Now reads:
int j = 0; // Declare j; the scope of j begins here
i++; // i is in scope here; increment it
All long equals signs are now separated by a thinspace, making
2 short equals signs (==).
"cannot contain a runtime expressions" should read "cannot contain a runtime
expression".
"are commonly used as a loop counters" should read "are commonly used as loop
counters".
Second sentence of this footnote has been removed.
... 0"));
only one ')' is needed
java.langThrowable
should be
java.lang.Throwable
Changed "java.langThrowable" to "java.lang.Throwable".
did read:
throw new IllegalArgumentException("x must be >= 0"));
now reads:
throw new IllegalArgumentException("x must be >= 0");
did read:
throw new IllegalArgumentException("x must be >= 0"));
now reads:
throw new IllegalArgumentException("x must be >= 0");
In the paragraph that starts "In previous discussions...", changed
the second to last sentence to read:
The finally clause gives us a way to write a while loop that handles the
continue statement in the same way that a for loop does.
After the second code block, added this new sentence:
Note, however, that placing the increment statement within a finally block
causes this while loop to respond to break statements differently than the
for loop does.
Changed "A method is a named collection of Java..."
to "A method is a named sequence of Java..."
Changed the fourth bullet item to read:
The checked exceptions that the method can throw (the signature may
also list unchecked exceptions, but these are not required)
java.lang.Constructor
Now reads:
java.lang.reflect.Constructor
At the start of the paragraph that begins "String literals can be only a
single line...":
The new opening sentence now reads "String literals cannot contain comments,
and may consist of only a single line."
At the start of the paragraph that begins "String literals can be only a
single line...":
A new opening sentence now reads "String literals cannot contain comments,
and may consist of only a single line."
Changed the following lines:
Class typeInt = int.type;
Class typeIntArray = int[].type;
To:
Class typeInt = int.class;
Class typeIntArray = int[].class;
Deleted this paragraph and replaced it with:
Every array has a length field that specifies the number of elements it
contains. Note that this field is read-only: you can use it to read the
length of the array, but you cannot assign any value to it or use it to
set or change the length of an array.
Changed the following two lines:
int[] values; // Array elements initialized elsewhere
int total = 0; // Store sum of elements here
To read:
int[] values; // Assume array is created and initialized elsewhere
int total = 0; // Store sum of elements here
"following code that manipulate" should read "following code that manipulates".
Under "Copying Objects and Arrays", "codex" now reads "code"
Added closing paren after Object, to read "(from Object),"
explicit cast.") should be deleted.
In third bulleted paragraph, the first sentence, "Arrays do not have a type
hierarchy, but..." should also be deleted.
A new bulleted paragraph at the end of the list (after the code example)
should be added:
An array of a primitive type cannot be converted to an
array of any other type. However, an array of reference
type A can be converted to an array of reference type B
through a widening or narrowing conversion if type A can
be converted to type B through a widening or narrowing
conversion. For example, a String[] value can be assigned
to a variable of type Object[].
Changed from:
public static void main(String args[])
To:
public static void main(String[] args)
Changed "C:>" to "%" at the beginning of the code line.
second-to-last sentence:
"(or -cp)" was added after "option".
The last sentence "You may also need to specify the -classpath option
to tell the interpreter to look for the classes..." now reads "You may also
need to specify the -classpath option to tell the interpreter where to look
for the classes..."
Changed "C:>" to "%" at the beginning of each code line.
Should mention that subclassing replaces most union behavior
Changed second sentence to read:
...simulate C varargs functions for simple cases, and arguments can also
be passed as an Object[],...
"which is is perfectly" should read "which it is perfectly".
"method has such an long, awkward" should read "method has such a long,
awkward".
"compiler determines which constructor you wish based" now reads "compiler
determines which constructor you wish to use based".
The line:
private static final NUMPTS = 500;
Now reads:
private static final int NUMPTS = 500;
And the last lines:
double x = 0.0, delta_x;
delta_x = (Circle.PI/2)/(NUMPTS-1);
Now read:
double x = 0.0;
double delta_x = (Circle.PI/2)/(NUMPTS-1);
First line of the code did read:
"private static finale"...
Now reads:
"private static final"...
first line of the code did read:
"private static finale"...
now reads:
"private static final"...
"free method" now reads "free function", as the C language doesn't have
methods.
"argso[]" now reads "args[]".
This code example is now on two lines, reading:
// Invoke the finalizer of our superclass.
super.finalize();
In the fourth paragraph, change "in the overriding method" to "in the
overriding class"
In the first sentence of the 5th paragraph, change "from within the method
that overrides it" to "from within the class that overrides it".
"there is no way for a program that uses an object" should read "there is no
way for a program that uses that object".
1st sentence:
"...from within the method that overrides it."
Now reads:
"...from within the class that overrides it."
"In an number of"
should read
"In a number of"
protected checkRadius(double radius){
...
}
the method should be:
protected void checkRadius(double radius){
...
}
The line:
protected checkRadius(double radius) {
Now reads:
protected void checkRadius(double radius) {
There was an unnecessary semi-colon after the definition of the getRadius()
method.
double totalDistance;
now reads
double totalDistance = 0;
"If you use an abstract clas, ...."
should be "class."
"upper-left" now reads "upper-right" to correspond with the example
The line:
public setUpperRightCorner(double x, double y);
Now reads:
public void setUpperRightCorner(double x, double y);
Did read:
public interface SuperShape implements Positionable, Transformable {}
Now reads:
public interface SuperShape extends Positionable, Transformable {}
did reads:
public interface SuperShape implements Positionable, Transformable {}
now reads:
public interface SuperShape extends Positionable, Transformable {}
In the following lines:
// This method returns an Enumeration...
public java.util.Enumeration enumerate() ...
Moved the second line right two spaces so it lines up
under "//".
And in these lines:
// The constructor uses the private head field...
public Enumerator() ( current ...
Moved the second line right four spaces so it lines up
under "//".
"...code using the LinkedStack class..."
Now reads:
"...code (in a different package) using the LinkedStack class..."
The 4th line:
Linkable current; = head;
Now reads:
Linkable currrent;
In the third column of the entry for "synchronized", change:
The method makes non-atomic modifications to the class or
instance, so care must be taken to ensure that two threads cannot
modify the class or instance at the same time.
To this:
The method is not inherently thread-safe, so this modifier tells
the Java interpreter to ensure that no other
<literal>synchronized</literal> method of this object or class
is run at the same time as this one.
t.getChars(0, 3, ca, 1); // Put 1st 3 chars of s into ca[1]-ca[3]
should read:
t.getChars(0, 3, ca, 1); // Put 1st 3 chars of t into ca[1]-ca[3]
The 4th line:
"String are immutable"
Now reads:
"String objects are immutable"
The line:
t.getChars(0, 3, ca, 1); // Put 1st 4 chars of s into ca at position 2
Now reads:
t.getChars(0, 3, ca, 1); // Put 1st 3 chars of s into ca[1]-ca[3]
t1 = Object.toString(); // Convert objects to strings with toString()
now reads
t1 = object.toString(); // Convert objects to strings with toString()
The line
t.getChars(0, 3, ca, 1); // Put 1st 3 chars of s into ca[1]-ca[3]
now reads
t.getChars(0, 3, ca, 1); // Put 1st 3 chars of t into ca[1]-ca[3]
The 3rd line:
short sh = Short.parseShort(sh);
Now reads:
short sh = Short.parseShort(s);
The statement "The valueOf() method can handle arbitrary bases" is incorrect--
it can only handle bases between Character.MIN_RADIX (==2) and
Character.MAX_RADIX (==36) inclusive.
// The valueOf() method can handle arbitrary bases
now reads
// The valueOf() method can handle arbitrary bases between 2 and 36
float f = generator.nextFloat(); // 0.0 <= d < 1.0
now reads:
float f = generator.nextFloat(); // 0.0 <= f < 1.0
config.getProperties("filterclass", // The property name
"com.davidflangan.filters.Default"); // A default
now reads
config.getProperty("filterclass", // The property name
"com.davidflanagan.filters.Default"); // A default
Also:
String classdir = config.getProperties("classpath");
now reads
String classdir = config.getProperty("classpath");
"import java.net.URLClassLoader;" now reads "import java.net.*;"
Also:
The line "Another technique:" was added after
} catch (Exception e) { /* Handle exceptions */ }
"does not run" now reads "does not typically run."
The code example is written:
Timer.schedule(displayTime, 0, 1000);
which is not correct. The line should be
timer.schedule(displayTime, 0, 1000);
to access the object "timer" and not the class "Timer".
Did read:
boolean keepRunning = true;
Now reads:
volatile boolean keepRunning = true;
did read:
boolean keepRunning = true;
now reads:
volatile boolean keepRunning = true;
"carefu" now reads "careful"
sorter.join();
now reads
try { sorter.join(); } catch(InterruptedException e) {}
"declare any sensitive methods" now reads "declare all sensitive methods."
reads "When a thread calls the wait() method of an object, any locks the thread
holds are temporarily released, and the thread is added..."
import java.util.*;
was inserted.
In line 5, "Server Socket" now reads "ServerSocket".
"host.domain.org" now reads "host.example.com".
When "indexed property" is defined (halfway down the page), "property" is
mistakenly split into "proper ty".
"proper ty" now reads "property".
The line:
* their sum. * @param c1 A Complex object
Now reads:
* their sum.
* @param c1 A Complex object
The line:
* their sum. * @param c1 A Complex object
now reads:
* their sum.
* @param c1 A Complex object
public Complex add(Complex c1, Complex c2) {
now reads
public static Complex add(Complex c1, Complex c2) {
Cut one "such as".
Changed "Hotspot" to "HotSpot"
Did read:
% setenv JAVA_COMPILER NONE // Unix syntax
Now reads:
% setenv JAVA_COMPILER NONE // Unix csh syntax
{343} constants of class Double;
Did read:
public static final double MIN_VALUE;
Now reads:
public static final double MIN_VALUE; =4.9E-324
(added the value)
"suspendx" now reads "suspend".
"Java 1.2x" now reads "Java 1.2".
Change:
<literal>lastModified() returns the modification time of the file
(which should be used for comparison with other file times only and
not interpreted as any particular time format)
To:
<literal>lastModified() returns the modification time of the file
in milliseconds since January 1st, 1970
"boolean value" now reads "Boolean object."
Deleted the sentence that began "equals() tests whether" and ended
"byte-for-byte equivalence)."
3rd paragraph:
Deleted the first sentence and replaced it with: equality of object references).
INDEX:
* BufferedReader entry now refers to pages 283-284.
* Added a new entry for "Resources for further information"
under "ResourceBundle class."
"1.2" flags were added to the lines for the public constants ONE and ZERO.
java.security.NoSuchProviderException, java.security.SignatureException;
Code, 7th line:
Did read:
,java.security.SignatureException {
Now reads:
java.security.NoSuchProviderException, java.security.SignatureException;
java.security.NoSuchProviderException, java.security.SignatureException;
did read:
,java.security.SignatureException {
now reads:
java.security.NoSuchProviderException, java.security.SignatureException;
Month MMM (name) MM (2 digits) M (1 or 2 digits)
to
Month MMMM (full name) MM (2 digits)
MMM (short name) M (1 or 2 digits)
...numbered from the birth of Christ that is used
is most locales throughout the world
should say:
...numbered from the birth of Christ that is used
in most locales throughout the world
"correctly,x" now reads "correctly."
In the fourth line down under the Set heading allAll(); now reads :
addAll().
IllegalBlocksSizeException
now reads:
IllegalBlockSizeException
INDEX:
An updated index was added.
IVParameterSpec
now reads:
IvParameterSpec
© 2014, O’Reilly Media, Inc.
(707) 827-7019
(800) 889-8969
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.