Errata
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 xiv Obtaining the Example Programs section |
This section is incorrect and needs to be replaced with the proper URL to download the code. |
Anonymous | ||
Page Chapter 3 (Comparison and Bounds): Covariant Overriding The block of code that outlines the definition of the class Object. |
class Object { Note from the Author or Editor: |
Anders Granlund | Mar 15, 2023 | ||
Page In many of the code examples. In many of the code examples. |
In general there are many small errors in the a lot of the examples needs to be fixed before they can be compiled. Note from the Author or Editor: |
Anders Granlund | Mar 26, 2023 | ||
Printed | Page 4 last code snippet |
In the line |
Anonymous | ||
Printed | Page 5 middle of the page |
"guaranteee" should read "guarantee" |
Anonymous | ||
Printed | Page 7 second code snippet |
The line Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 12 2nd code snippet and 3rd paragraph |
The line Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | |
Page 12 code snippet 1 |
the use of toString() in the assert is slightly dangerous. Note from the Author or Editor: |
Anonymous | Jul 27, 2009 | ||
Printed | Page 16 3rd line |
"Collections" should be "Collection" |
Anonymous | ||
Page 16 3rd code snippet |
A list which is created by method Arrays.asList(T...) cannot be manipulated via method add() of Note from the Author or Editor: |
Anonymous | |||
Page 16 Last sentence |
The order of the two words "List<Integer>" and "List<Number>" in the last sentence of page 16 Note from the Author or Editor: |
Anonymous | |||
Page 19 First line |
The following error report (listed on the unconfirmed error reports page) is wrong: Note from the Author or Editor: |
Anonymous | Jul 24, 2008 | ||
Page 19 line 2 |
"as required by the super" should be "as required by the super wildcard" Note from the Author or Editor: |
Anonymous | |||
Printed | Page 19 line 2 |
"as required by the super" should be "as required by the super wildcard" Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Page 21 Last code snippet - third line |
ints.add(3) is ok at compile-time, but fails to execute at runtime. The reason is that the Note from the Author or Editor: |
Anonymous | |||
Page 22 second para, after code sample |
The section describes the bounding of get and put for generics - "Similarly, you Note from the Author or Editor: |
Anonymous | |||
Page 23 The 2 code blocks in the middle of the page. |
The code is listed as: Note from the Author or Editor: |
Anonymous | |||
Page 24 3rd paragraph |
"Arrays of primitive type are much more efficient ... assignments into such an array need not Note from the Author or Editor: |
Anonymous | |||
Page 27 4th paragraph |
The method reverse does not compile. The type parameter T should appear before the return type void of the generic method reverse. Here's the method in error. Note from the Author or Editor: |
Ravindra Ranwala | Mar 25, 2020 | ||
Page 29 4th paragraph |
Change "at" to "as" in "elements from the inner lists at any other type". Note from the Author or Editor: |
Anonymous | |||
Page 29 Last example |
In the last example, the statement calling the generic method missing the target variable name. Note from the Author or Editor: |
Ravindra Ranwala | Mar 25, 2020 | ||
Page 30 Last paragraph |
The line Note from the Author or Editor: |
Maurice Naftalin | Sep 11, 2015 | ||
Printed | Page 31 first line |
"more-advanced" should be "more advanced" |
Anonymous | ||
Page 31 3.1 2nd paragraph "The compareTo method..." |
The book contains : Note from the Author or Editor: |
Anonymous | |||
Page 32 2nd to last paragraph |
"Comparison differs from equality in that >>is<< does not accept a null argument" Note from the Author or Editor: |
Anonymous | Sep 10, 2013 | ||
Page 33 5th last paragraph |
The sentence "Every value is compares as the same as itself" does not make sense. Note from the Author or Editor: |
Anonymous | |||
Page 33 after first example |
What property is being generalized here? How can x<y iff y<x Note from the Author or Editor: |
Anonymous | |||
Page 33 3rd para from bottom of page |
The paragraph starts "However, it is always required..." Note from the Author or Editor: |
Thomas Costick | Mar 08, 2011 | ||
Page 33 several places |
The two occurrences of "this generalizes the property for integers" could be replaced by the more general "this generalizes the property for numbers", which is also used on the page. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 | |
Printed | Page 34 Last code block |
Sign of comparison is wrong ("") |
Maurice Naftalin |
Dec 02, 2013 | |
Printed | Page 35 compile-time error entry |
should be 3.14 not 3,14 since that is not the compile error being demonstrated |
Anonymous | ||
Page 35 4th paragraph |
lnteger should be Integer (it starts with a lower-case L) Note from the Author or Editor: |
Anonymous | Sep 10, 2013 | ||
Page 36 |
Example 3-1 and example 3-2 have the wrong order in the text! Note from the Author or Editor: |
Randolf Rothfuss | Aug 03, 2012 | ||
Page 36 section 3.3 - 2nd paragraph |
The book says, Following good practice, we have also defined a hashCode method, to ensure that equal objects have the same hash code. But the hashCode method is missing in the given source code. Better include this method in the Frutty example code. Here's a sample. Note from the Author or Editor: |
Ravindra Ranwala | Mar 26, 2020 | ||
Page 37 Comparator |
The text says the Comparator interface contains a single method: Note from the Author or Editor: |
Anonymous | |||
Page 37 5th paragraph |
Below is the text that appears in page 37 while explaining the need to modify the type signature of the method "compareTo" to use "super" wildcard : Note from the Author or Editor: |
sateesh | Jan 05, 2010 | ||
Page 38 class Fruit |
In the examples on pages 38 and 39, the classes define the "hash" method and call the "hash" Note from the Author or Editor: |
Anonymous | |||
Page 41 last paragraph |
The text states "By the contract for comparators, it would be equivalent to leave the arguments Note from the Author or Editor: |
Anonymous | |||
Page 41 2nd code snippet |
The code snippet that creates an instance of Comparator that provides natural ordering (2nd code snippet in page 41) gives compilation error. Note from the Author or Editor: |
sateesh | Jan 06, 2010 | ||
Page 42 3rd para from bottom |
"panic.Actually" should be "panic. Actually" Note from the Author or Editor: |
Anonymous | Sep 23, 2013 | ||
Page 42 last code snippet, 2nd line |
The parameter declaration "Comparator<E> comp" should be changed to "Comparator<? super E> comp" to make the method applicable in more cases. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 | |
Page 47 code snippets |
The 'copy' method does not close the given streams if an exception occurs. In general, streams should be closed in 'finally' blocks. Additionally, they should be closed in the code block where they were opened, because otherwise even a 'finally' block is not really reliable. For example, if the third line in the second code snippet throws an exception, the stream opened in the second line will remain open. In a nutshell: A code block should close the streams it opens, but no others. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 | |
Page 48 2nd paragraph from bottom |
The paragraph explains the code example 3.6, but has the "first" and "second" method the wrong way around. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | ||
Page 50 4th paragraph |
According to the Java Language Specification, 3rd ed, �8.4.2, the signature of a method does not include its return type. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 | |
Printed | Page 54 code snippet in middle of page |
The code snippet contains the method Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Page 56 Section 4.4 on Erasure, after the "class Overloaded" code snippet |
In the discussion of erasure and method overloading, it is stated that the return type of the methods (in this case the method sum()) distinguishes two methods from each other. This is a Java 1.5 compiler bug addressed by Java Sun Bug ID: 6182950. The class Overloaded should generate a compile warning when this bug is fixed, since due to erasure both sum() methods have the same name and same argument list, and therefore are indistinguishable. In general, method return types cannot be used to distinguish between overloaded methods. Note from the Author or Editor: |
Anonymous | Jun 29, 2010 | ||
Page 56 First bullet point |
"Appendable & Closeable" should be in fixed-width font. |
Philip Wadler | Jan 15, 2015 | ||
Page 56 Last paragraph before final display |
"However, say we change the methods so that each appends its result to the end of the |
Philip Wadler | Jan 15, 2015 | ||
Page 58 ninth bullet point |
"The erasures of S and T in the definition of copy are Appendable and Readable, because S has Note from the Author or Editor: |
Anonymous | |||
Page 59 sample listing Overloaded2 |
Not really a technical mistake, more of an issue in editing. The text says: "However, say we change the Note from the Author or Editor: |
Anonymous | |||
Printed | Page 81 4th paragraph |
As far as I know, C# generics are reified, so the statement "unchecked casts in C# are much more dangerous than unchecked casts in Java" is wrong - there are no unchecked casts in C#. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 86 first line of first full paragraph (after code snippet) |
"unchecked cast to T()" should read "unchecked cast to T[]" |
Anonymous | ||
Printed | Page 93 7th line from bottom |
In the line Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 99 second paragraph |
There's an exclaimation point in the middle of the phrase "generics!for reflection" |
Anonymous | ||
Printed | Page 100 1st paragraph |
The statement "it often is more robust to use equality (the equals method) [than the == operator]" is true in general, but wrong if only Class objects are concerned (as seems to be implied in this paragraph), because java.lang.Class does not overide equals(). If cls1 is a java.lang.Class object, cls1 == cls2 is always equivalent to cls1.equals(cls2), even if multiple class loaders are involved. Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 120 3rd line from bottom |
"by the sublist method" should be "by the subList method". Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 132 2nd paragraph from bottom |
Throwable is a checked exception, so the sentence Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 137 last paragraph |
"expects an arguement" should be "expects an argument" |
Anonymous | ||
Printed | Page 137 last paragraph |
"expects an arguement" should be "expects an argument" Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 139 last code snippet |
"abstract class Trust<T extends Trust>" Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Printed | Page 152 Figure 10.1 |
"ConcurrenNavigableMap" should read "ConcurrentNavigableMap" |
Anonymous | ||
Printed | Page 159 2nd last paragraph |
Remove "the" from "This is particularly true for the a graphical user interface". |
Anonymous | ||
Printed | Page 162 second full paragraph |
The apostrophy in "collection's" appears as a registered trademark symbol. |
Anonymous | ||
Page 167 2nd paragraph |
Note that phoneTuesdayTasks has the type List<Task> , while tuesdayPhoneTasks has the Note from the Author or Editor: |
Ravindra Ranwala | May 05, 2021 | ||
Printed | Page 242 last paragraph |
The phrase |
Anonymous |