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 Chapter 4 (Declarations): Static Members First paragraph. |
In 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 | ||
Page 7 Second Sentence |
States that reference type is any "class, instance, or array type." The Java Specification says |
Anonymous | |||
Page 7 left column of table of Primitive and Reference types in Java |
Primitive type should be boolean, not bool. Note from the Author or Editor: |
Anonymous | |||
Page 7 3rd paragraph |
the line Note from the Author or Editor: |
Anonymous | Jul 26, 2009 | ||
Page 7 5th paragraph |
The paragraph Note from the Author or Editor: |
Anonymous | Jul 26, 2009 | ||
Page 7 1st paragraph |
"A reference type is any class, instance, or array type." Note from the Author or Editor: |
Anonymous | Oct 31, 2009 | ||
| Printed | Page 7 second code snippet |
The line Note from the Author or Editor: |
Anonymous | Jul 26, 2008 | Feb 01, 2009 |
Page 9 4th paragraph |
Note from the Author or Editor: |
Anonymous | Jul 26, 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, fourth line |
the rightmost parenthesis must be removed or else the code won't compile Note from the Author or Editor: |
Anonymous | |||
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 | |||
Page 78 Paragraph before the last |
Another example of the use of unchecked casts to interface legacy and generic code occurred in Section 5.4.1, where we needed an unchecked cast to the element type (E) to make the type of the value returned by the legacy add method match its generic signature. Note from the Author or Editor: |
Ravindra Ranwala | Apr 06, 2020 | ||
| 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 |
Page 84 excerpt of code |
1. The method is defined as Note from the Author or Editor: |
Anonymous | Dec 04, 2013 | ||
| Printed | Page 86 first line of first full paragraph (after code snippet) |
"unchecked cast to T()" should read "unchecked cast to T[]" |
Anonymous | ||
Page 87 Example 6.1 DeceptiveLibrary |
Method intLists, the return variable name should be intLists, not ints. In fact, there's no variable declared with the name ints inside the body of this method. So, this statement is wrong. Note from the Author or Editor: |
Ravindra Ranwala | Apr 07, 2020 | ||
Page 91 Last example |
Method singleton should have it's type variable declared before the return type of the method. The correct declaration should be something like this. Note from the Author or Editor: |
Ravindra Ranwala | Apr 10, 2020 | ||
| 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 |
Page 103 Chapter 7.3 paragraph 3 |
Printing History: October 2006 First Edition. Note from the Author or Editor: |
Anonymous | |||
Page 104 Example 1.7, line 8 |
Line 8 of Example 1.7 should be: Note from the Author or Editor: |
Valentin Baca | Apr 07, 2013 | ||
Page 114 2nd senetence |
The sentence Note from the Author or Editor: |
Anonymous | May 16, 2012 | ||
Page 119 3rd paragraph, first line |
thiry-three should be thirty-three Note from the Author or Editor: |
Svein Egil Nilsen | Aug 31, 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 |
Page 128 line 9 after 9.3 |
The line says: 'An exception is checked if it is a subclass of RuntimeException or Error'. Of course this must be: 'An exception is unchecked...' Note from the Author or Editor: |
Jan de Ruiter | May 26, 2010 | ||
Page 128 9.3 Function, 1st paragraph |
The line, Note from the Author or Editor: |
Ravindra Ranwala | Dec 02, 2020 | ||
| 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 |
Page 133 10th line from page's top (conting blank lines too) |
In class Functions, method List<B> applyAll(List<A> list) signature should be missing a second Note from the Author or Editor: |
Anonymous | |||
Page 133 Entire page |
Example 9.5 on page 133 does not match the text surrounding it and does not compile. Note from the Author or Editor: |
Anonymous | |||
| 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 |
Page 143 21st line |
public void update(S o, A a); Note from the Author or Editor: |
mat | Aug 15, 2009 | ||
Page 151 Second paragraph |
"For example, in the previous expression the first two terms are comparable for low values of N; in fact, for N < 8, the second term is larger." Note from the Author or Editor: |
Emanuel Frua | Mar 04, 2016 | ||
| Printed | Page 152 Figure 10.1 |
"ConcurrenNavigableMap" should read "ConcurrentNavigableMap" |
Anonymous | ||
Page 154 Example 11.1 |
Example 11.1 is supposed to be "just about the simplest possible example of how Note from the Author or Editor: |
Anonymous | |||
Page 154 2nd para |
The 2nd paragraph should indicate that the provided scenario is one (of many) possible non-thread-safe scenarios[1]. Note from the Author or Editor: |
Anonymous | Feb 03, 2010 | ||
| Printed | Page 159 2nd last paragraph |
Remove "the" from "This is particularly true for the a graphical user interface". |
Anonymous | ||
Page 160 implementation of pop() |
The implementation of the pop() method for ArrayStack on page 160 is incorrect. The code executed if the 'if' condition evaluates to true reads: Note from the Author or Editor: |
Pete_Clark | Jul 07, 2013 | ||
| Printed | Page 162 second full paragraph |
The apostrophy in "collection's" appears as a registered trademark symbol. |
Anonymous | ||
Page 163 3rd, 4th and 5th example code fragments |
The example uses, Note from the Author or Editor: |
Ravindra Ranwala | May 01, 2020 | ||
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 | ||
Page 170 last paragraph |
"used to by ordered collections" Note from the Author or Editor: |
Anonymous | |||
Page 170 top of page |
List<Integer> l = Array.asList(0,1,2); Note from the Author or Editor: |
Anonymous | |||
Page 172 2nd paragraph, last line |
Missing space. Note from the Author or Editor: |
Svein Egil Nilsen | Sep 02, 2009 | ||
Page 176 first paragraph of section 12.3 |
"We will go on to look at these three main kinds" Note from the Author or Editor: |
Anonymous | |||
Page 181 Figure 13.3 |
The curved arrow starting at 'a' should point to 'b' instead of to 'j' and the curved arrow from Note from the Author or Editor: |
Anonymous | |||
Page 182 second full paragraph |
In the sentence "These are snapshot iterators; they reflect the state of the set at the time it Note from the Author or Editor: |
Anonymous | |||
Page 184 Last paragraph |
In the last paragraph, second sentence says, Note from the Author or Editor: |
Ravindra Ranwala | May 05, 2020 | ||
Page 192 code snippets at bottom of page |
Some of the source markup is leaking through into the rendered text. The words "verb Note from the Author or Editor: |
Anonymous | |||
Page 192 Figure 14-1. Queue |
There's no method called removed() in Queue interface, rather it should be remove() Note from the Author or Editor: |
Ravindra Ranwala | May 10, 2020 | ||
Page 194 Last paragraph |
The first sentence says, |
Ravindra Ranwala | May 10, 2020 | ||
Page 205 1st paragraph |
The first sentence of the first paragraph says, Note from the Author or Editor: |
Ravindra Ranwala | May 12, 2020 | ||
Page 207 4th paragraph |
Both occurances of "null" in this paragraph should say "false" instead. Note from the Author or Editor: |
Anonymous | |||
Page 207 last paragraph |
The text states that "the only way of ensuring that variable writes made by one thread are Note from the Author or Editor: |
Anonymous | |||
Page 211 Last paragraph |
In the middle of the paragraph, it says, Note from the Author or Editor: |
Ravindra Ranwala | May 13, 2020 | ||
Page 218 First example |
The signature of the method getSubschedule is not correct. It's return type should be ListIterator<StoppableTaskQueue> instead of listIterator<StoppableTaskQueue>. The correct version is given in the sample code though. Note from the Author or Editor: |
Ravindra Ranwala | May 14, 2020 | ||
Page 219 Last example |
The last example contains the code fragment, Note from the Author or Editor: |
Ravindra Ranwala | May 18, 2020 | ||
Page 220 Last paragraph |
The first sentence of the last paragraph says, Note from the Author or Editor: |
Ravindra Ranwala | May 18, 2020 | ||
Page 223 2nd paragraph |
Second sentence reads "It optimizes read access, in line with one of our requirement." The last word should be plural, and it should probably read "It optimizes read access, in line with one of our requirements." Note from the Author or Editor: |
Pete_Clark | Jul 09, 2013 | ||
Page 227 1st paragraph of section 15.3 |
The sentence Note from the Author or Editor: |
Anonymous | |||
Page 229 First example |
The class BoundedSizeMap is a raw type. Since the book emphasizes on effective use of generics and collections framework, it is better to use generics there. Here's a sample implementation using generics. Note from the Author or Editor: |
Ravindra Ranwala | May 20, 2020 | ||
Page 232 Last line of the 2nd paragraph |
Deletions are trickier than with chaining; if key2 and value2 were removed from the table in Figure 13-2, key3 and value3 would have to be moved along to take their place. The Figure 13-2, is wrong and should be corrected as Figure 16-4 Note from the Author or Editor: |
Ravindra Ranwala | Jul 01, 2021 | ||
| Printed | Page 242 last paragraph |
The phrase |
Anonymous | ||
Page 245 under 16.5.1 |
The book states iterators (of concurrent Map implementations - not clear, the section is about Note from the Author or Editor: |
Anonymous | |||
Page 247ff Chapter 17 |
While chapter 17 gives the impression that all the methods of the java.util.Collections class Note from the Author or Editor: |
Anonymous |