Errata
The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted by | Date submitted |
---|---|---|---|---|
ePub | Page examples examples |
As opposed to version 3, the link for the examples points to a git repository. The download does have the examples-eclipse.zip archive, but the instructions in the book don't work with eclipse. When I follow the instructions, a folder "LearningJava" is generated *inside* the previously created Learning Java project, and under that folder there are the bin and src folders. In Learning Java 3 the zip file structure did *not* include the Learning Java directory and it could be imported (following the Learning Java 4. ed instructions). So, I think you need to strip the LeaningJava folder from the zip archive. I've tried that but then the dot files parallel to bin and src don't work correctly, they form a hierarchy in Eclipse as follows: |
Erwin J Prinz | Jun 28, 2013 |
ePub | Page epub examples |
I have tried to load the examples in Ubuntu 13.04 using the Eclipse Juno from eclipse.org, and also in Windows 7 using Eclipse Juno. The behavior is the same. From edition 3, the examples load and can be run and there are a few syntax errors (probably because I am running version 1.7 Java). From edition 4, the hierarchy gets screwed up because the zip file has more hierarchy (because it is probably the entire git project). If I follow the instructions, I can't run even the chapter 2 example without error, there is a message that there is no "main" method although there is one in the file, so the .classpath is probably wrong. |
Erwin J Prinz | Jun 29, 2013 |
ch06s04 Subclasses and Visibility |
https://www.oreilly.com/library/view/learning-java-4th/9781449372477/ch06s04.html |
Ihar Vaitovich | Nov 19, 2019 | |
Other Digital Version | 1 Table of Contents on the web site listing |
Hi! The Table of Contents listing for this book has 3-4 places where it looks like an editing comment in either a chapter header or ToC entry. Look for things like this: |
Chris Spruck | Jun 24, 2013 |
2 3rd paragraph |
but we’ll need this when we have to explicitly pass a reference to our object to a method in another class. We often do this so that methods in other classes can invoke our public methods or use our public variables. |
Anonymous | Jul 25, 2017 | |
Printed | Page 24 top |
The link to http://oreil.ly/Java_4E is broken. |
Dave Slomer | Aug 24, 2013 |
Page 28 instructions for importing examples-eclipse.zip |
when examples-eclipse.zip is imported per the instructions in the book attempts to run any of the code in eclipse result in the following error message; |
Anonymous | Jul 30, 2013 | |
Page 28 Singapore |
On page 28 you declare: |
John Berns | Sep 14, 2013 | |
Page 28 Singapore |
Eclipse setup, importing of sample code are completely broken; files referenced are not available on the sample code download site. Other similarly named files import but won't run due to errors. |
John Berns | Sep 14, 2013 | |
Page 28 Singapore |
Instructions to load example code into Eclipse is incorrect. Following book results in errors and code does not run. |
John Berns | Sep 15, 2013 | |
Page 28 First paragraph |
The book indicates that one should find the file examples-eclipse.zip at the provided link. However the link leads to the product page. I followed the examples link to the GitHub repo. I cloned the repo and assumed that would work. However the code there works on the command line but creates errors re: there being no main when imported into Eclipse. I then found the compressed archive on the Git page, so I downloaded and imported that. Same errors. It was only after searching through the archive that I found the Eclipse folder and imported the archive therein. |
Bryan Dobberstein | Sep 25, 2013 | |
Page 28 2 |
Others have already commented on it, but your examples simply do not work well when imported into the Eclipse editor. |
Jeff Nyman | Dec 08, 2013 | |
Page 35 HelloComponent code |
The following import is missing from the code: |
Calvin D | Dec 05, 2013 | |
Printed | Page 38 Figure 2-6 |
The class hierarchy used to illustrate inheritance shows HelloJava1 as a subclass of JComponent. There is no mention of HelloJava1 previously (only HelloJava and HelloJava2) and this should actually be HelloComponent which extends JComponent in the previous example. |
Benjamin Petersen | Jul 11, 2013 |
Printed | Page 38 Figure 2-6 |
The class hierarchy used to illustrate inheritance shows HelloJava1 as a subclass of JComponent. There is no mention of HelloJava1 previously (only HelloJava and HelloJava2) and this should actually be HelloComponent which extends JComponent in the previous example. |
Benjamin Petersen | Jul 11, 2013 |
60 United States |
The 1st examples HelloJava1.java-HelloJava4.java do not contain a main() so they are unable to compile. |
Matt M | Jul 05, 2013 | |
ePub | Page 84% in book (epub) First paragraph of Appendix A, epub edition |
"develoment tools" |
Erwin J Prinz | Jun 23, 2013 |
Printed | Page 90 code in 2nd 3rd paragraph |
the declaration of pi does not compile. "F" is missing at the end of the number. Without "F" the literal is assumed to be double and can not be implicitly converted to float. Another alternative is to declare pi as double. |
Yahya Almubarak | Apr 16, 2015 |
Printed, PDF, ePub | Page 100 programmatic loop atop page |
The loop does not contain a break or a continue statement to illustrate the optional label that control can be forced to branch to. |
Dave Slomer | Aug 25, 2013 |
Printed | Page 112 3rd paragraph under heading "Throwing Exceptions" |
The sentence reading "...the Exception object's getMessage() method" should read "...the Throwable object's getMessage() method" -- the getMessage() method is a member of the Throwable class, rather than the Exception class (which inherits from Throwable). |
Scott Wright | Jan 12, 2016 |
Printed | Page 114 3rd code fragment |
"catch ( IOException cause )" should be "catch ( IOException e )". The subsequent code references the variable "e", not the variable "cause". |
Eric K | Jul 24, 2013 |
Printed | Page 114 middle of page |
At the page 114, code sample: |
Anonymous | Aug 12, 2014 |
Printed | Page 120 3rd command |
There is a missing blank space after the "...". The command line should read "% java -ea:com.oreilly.examples... MyApplication". In other words, "MyApplication" should be a separate word. |
Eric K | Jul 24, 2013 |
Printed | Page 120 code in the 2nd paragraph |
Semicolon is missed t the end of the last statements. |
Yahya Almubarak | Apr 16, 2015 |
Printed | Page 123 last paragraph, second sentence |
The element's index is 0 or 19, not the element itself. |
Yahya Almubarak | Apr 16, 2015 |
Printed | Page 126 5th paragraph |
"ArrayscopyOf" should be "Arrays.copyOf" in the sentence "An easier way is to use the java.util.Arrays.copyOf() and copyOfRange() methods." |
Eric K | Jul 24, 2013 |
Printed, PDF, ePub | Page 126 Just before last code segment |
Missing period in " ArraysCopyOf " (no such method), which SHOULD read as shown: |
Dave Slomer | Aug 25, 2013 |
Printed | Page 126 4th paragraph, 1st sentence |
A period between the class name and the method is missing. It should read java.util.Arrays.copyOf |
Yahya Almubarak | Apr 16, 2015 |
Page 140 example |
// instance var = local vra |
Brian Tkatch | May 15, 2015 | |
Page 176 beginning of bottom paragraph |
"Abstract classes provide a framework for classes that is to be “filled in” by the implementer." should be "that are". The classes are filled in, not the framework. |
Brian Tkatch | May 18, 2015 | |
Page 177 2nd paragraph in Interfaces |
"Similarly, an interface is a list of methods that define " |
Brian Tkatch | May 18, 2015 | |
Page 192 3rd paragraph, 3rd line |
"To do this requires that " |
Brian Tkatch | May 18, 2015 | |
Printed | Page 196 1st code example |
The static class "MigrationPattern" needs the public access modifier added to it, otherwise the code example immediately following it doesn't work. |
Jason Gero | Jan 30, 2016 |
Page 227 first line |
List<String> listOfStrings = new ArrayList<String> |
Brian Tkatch | May 19, 2015 | |
Printed | Page 230 1st example |
When I try the example I get this: |
Andrew Chapman | Feb 11, 2014 |
Page 235 3rd paragraph under Casts |
"The cast is plausible here because a Collection<Date> is assignable from and could actually be a List<Date>." |
Brian Tkatch | May 20, 2015 | |
Page 249 United States |
In this code: |
Chap Huskison | Jul 20, 2014 | |
Page 262 example above figure 9-1 |
extraneous "n" above example. |
Brian Tkatch | May 20, 2015 | |
Page 265 footnote 1 |
"interrupt() has not worked consistently in all Java implementations historically." |
Brian Tkatch | May 20, 2015 | |
Page 276 2nd paragraph, 3rd sentence |
"waiter wakes up and rejoins related in vying for the MyThing lock." |
Brian Tkatch | May 21, 2015 | |
Printed | Page 282 footnote 3 |
Footnote 3 references the web page https://rtsj.dev.java.net/, which appears gone/defunct. |
Scott Wright | Jan 25, 2016 |
Printed | Page 285 Code snippet in the middle of page 285 |
Dear authors, |
David Robillard | Apr 28, 2015 |
Printed | Page 286 Code at the bottom of the page |
The code at the bottom of page 286 is taking three lines. As in : |
David Robillard | Apr 28, 2015 |
Printed | Page 296 last paragraph |
The final paragraph on the page mentions a class ThreadPoolExecutorSevice. The API documentation does not include this class. Was the class ThreadPoolExecutor (as in the section title) intended? |
Scott Wright | Jan 27, 2016 |
Printed | Page 303 3rd paragraph |
The mentioned ThreadgetName() method is missing the period between the class name and the method name: it should be "Thread.getName()". |
Scott Wright | Jan 26, 2016 |
Printed | Page 311 3rd paragraph |
The list of atomic classes appears to have inadvertently included the ".java" file name extension on each item. |
Scott Wright | Jan 27, 2016 |
Printed | Page 334 paragraph immediately preceding "String Conversions" heading |
The reference to the constant width formatted "argument index" (of the preceding format string) is missing the underscore: it should be "argument_index". |
Scott Wright | Jan 28, 2016 |
Printed | Page 336 Table 10-3 |
The 'c' conversion character also has a 'C' version. |
Scott Wright | Jan 29, 2016 |
Page 347 Under the heading "Grouping" |
The regular expression is incorrect. |
Michael Davoli | Aug 14, 2014 | |
Page 348 United States |
The second pattern matching example is incorrect. |
Michael Davoli | Aug 14, 2014 | |
Page 349 Top of page, bottom of previous page |
From the text: |
Michael Davoli | Aug 14, 2014 | |
Page 350 Middle of page |
The text reads: |
Michael Davoli | Aug 15, 2014 | |
Page 351 Middle of page |
Appears to be a typo: |
Michael Davoli | Aug 18, 2014 | |
PDF, Mobi | Page 354 1st paragraph and first example |
The example loop for Matcher.group on p.354 is probably not what authors intended. The loop end condition |
Bruce Wisentaner | Jul 13, 2013 |
Page 355 Under the heading "Replacing Text" |
There is a typo in the pattern: |
Michael Davoli | Aug 18, 2014 | |
Printed | Page 355 After heading "Using captured text in a replacement." |
An extra period crept in following the heading, preceding the start of the next sentence. |
Scott Wright | Feb 01, 2016 |
Page 356 Bottom of page |
There is a typo in this statement: |
Michael Davoli | Aug 18, 2014 | |
Page 357 Bottom of page |
It looks like your text editor substituted the two adjacent dashes for an "em dash", \u2014. |
Michael Davoli | Aug 18, 2014 | |
Printed | Page 366 code sample above last paragraph |
The first line of the sample code was split across two lines. |
Scott Wright | Feb 03, 2016 |
Printed | Page 367 Figure 11-1 caption |
The figure caption reads "...localized data and time" but the word "data" was probably meant to be "date". |
Scott Wright | Feb 03, 2016 |
Page 369 Top of page, third example |
The comment is wrong: |
Michael Davoli | Aug 18, 2014 | |
Page 369 Bottom of page |
The string literal is wrong: |
Michael Davoli | Aug 18, 2014 | |
Page 377 Bottom of page |
In the code example, there is a typo in the variable name: |
Michael Davoli | Aug 19, 2014 | |
Printed | Page 379 fisrt line on page |
The signature for set() should be "public E set(..." (type E should replace the Object type). |
Scott Wright | Feb 03, 2016 |
Printed | Page 385 Table 11-7 |
For the Set interface, the implementation CopyOnWriteArraySet appears twice in the list of implementations. |
Scott Wright | Feb 04, 2016 |
Page 394 Under the heading "Loading and Storing" |
In the code example: |
Michael Davoli | Aug 19, 2014 | |
Printed | Page 400 last paragraph |
The static field Logger.global is deprecated. The API documentation recommends calling Logger.getGlobal() [or Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) or Logger.getLogger("global") if Logger.getGlobal() is unavailable {pre-1.7}]. |
Scott Wright | Feb 06, 2016 |
Page 409 4th paragraph, 5th sentence |
Sentence begins: |
Paul Waring | Dec 28, 2015 | |
Page 415 3rd paragraph |
in the code example: |
Anonymous | Dec 29, 2013 | |
Printed | Page 418 Section entitled "Buffered streams" |
Is there a reason/story/explanation why BufferedOutputStream and BufferedInputStream derive from their respective Filter*Stream classes whereas BufferedReader and BufferedWriter *do not* derive from FilterWriter and FilterReader? This asymmetry disorients me. |
Scott Wright | Feb 10, 2016 |
Printed | Page 425 First paragraph after heading "File I/O" |
The end of the second line reads "... the core java.io File I/O facility..." with "File" curiously capitalized. was "... the core java.io.File I/O facility..." (a fully-specified class name) intended? |
Scott Wright | Feb 09, 2016 |
Page 427 Bottom of page |
The path is incorrect, you have a double backslash after c: |
Michael Davoli | Aug 28, 2014 | |
Printed | Page 430 Table 12-1 |
The listRoots() method is static, although is not highlighted as such in the table (like createTempFile). |
Scott Wright | Feb 11, 2016 |
Printed | Page 430 Table 12-1 |
The final method in the table, toURL(), is deprecated. The latest API docs recommend using toURI() instead. |
Scott Wright | Feb 11, 2016 |
Page 431 Bottom of page, code example |
In the code example, the variable "file" is defined twice: |
Michael Davoli | Aug 29, 2014 | |
Printed | Page 434 3rd paragraph |
In the second sentence, the second occurrence of the string "URL" looks like it should be in the fixed width font as the class providing the openStream() method. |
Scott Wright | Feb 11, 2016 |
Printed | Page 436 first paragraph |
In the first sentence: "...new, NIO, File API introduced with Java 7." -- NIO was introduced with Java 1.4. |
Scott Wright | Feb 11, 2016 |
Page 437 Bottom of page |
Typo, missing space between words: |
Michael Davoli | Aug 31, 2014 | |
Page 438 Table 12.2, description of copy() method |
Typo, "files" should be possessive, not plural: |
Michael Davoli | Sep 02, 2014 | |
Printed | Page 438 paragraph following "Path to classic file and back" heading |
In the last sentence of the paragraph, the word "File" should probably be in the "constant width" font as this seems to be a reference to the java.io.File class. |
Scott Wright | Feb 10, 2016 |
Page 440 Table 12.2, description of newByteChannel() method |
Typo. Missing ".": |
Michael Davoli | Sep 02, 2014 | |
Page 440 Table 12.2, description of newOutputStream() method |
Typo: |
Michael Davoli | Sep 02, 2014 | |
Printed | Page 440 entry for newByteChannel() |
In the description: "...using FileChannelopen() as an..." -- looks like a period is missing from the method reference [i.e. "FileChannel.open()"]. |
Scott Wright | Feb 11, 2016 |
Page 441 Top of page, second sentence. |
Typo, misspelled "directories": |
Michael Davoli | Sep 02, 2014 | |
Page 441 Third paragraph |
Typo, "read all" should be "readAll" or "readAll()": |
Michael Davoli | Sep 02, 2014 | |
Page 442 Bottom of page |
Typo, missing ".": |
Michael Davoli | Sep 02, 2014 | |
Page 443 First paragraph |
Typo, missing period "." |
Michael Davoli | Sep 03, 2014 | |
Printed | Page 450 code sample at top of page |
The code segment won't quite compile as given -- the "entry" variable is declared twice. |
Scott Wright | Feb 11, 2016 |
Page 452 Bottom of page |
Missing period: |
Michael Davoli | Sep 04, 2014 | |
Printed | Page 452 first paragraph following heading "Zip Archive as a File System" |
In the first sentence, "introduce" should be in past tense: "introduced". |
Scott Wright | Feb 12, 2016 |
Page 454 1st paragraph, 7th sentence |
7th sentence begins: |
Paul Waring | Dec 29, 2015 | |
Page 461 Under the heading "FileChannel" |
Missing period: |
Michael Davoli | Sep 04, 2014 | |
Page 465 Under the heading "Direct Transfer" |
Missing period: |
Michael Davoli | Sep 04, 2014 | |
Page 466 First paragraph, fourth sentence |
Strange word "boh" in middle of sentence. Needs to be removed: |
Michael Davoli | Sep 04, 2014 | |
Page 483 Top of Page, Under SO_TIMEOUT |
Both the description and the code example use the wrong exception, it should be a "SocketTimeoutException". |
Michael Davoli | Sep 08, 2014 | |
Printed | Page 501 2nd to last paragraph |
The second sentence is missing a space after the terminating period before the next sentence: "...server.main()..." -> "..server. main()..." |
Scott Wright | Feb 18, 2016 |
Printed | Page 503 first line (sample code) |
A space is missing between the class name and the argument. |
Scott Wright | Feb 18, 2016 |
Printed | Page 505 command-line example at top of page |
The final word, "MyServer" probably is not meant to be in italic font. |
Scott Wright | Feb 18, 2016 |
Printed | Page 512 paragraph preceding section heading "LargerHttpd" |
In the first sentence, Chapter 1 is referenced for the Iterator class -- whas Chapter 11 intended? |
Scott Wright | Feb 19, 2016 |
Page 567 Toward the top of the page |
Misnamed the @ServletSecurity annotation, you called it SecurityServlet: |
Michael Davoli | Sep 13, 2014 | |
Page 573 Top of page. |
The paragraph states: |
Michael Davoli | Sep 14, 2014 | |
Printed | Page 599 first line |
The description of getParent() is missing.. |
Scott Wright | Feb 22, 2016 |
Printed | Page 602 last paragraph |
The text mis-states that JFrame is a subclass of JWindow -- JFrame and JWindow are both subclasses of (AWT) Window, but JFrame is not a subclass of JWindow. |
Scott Wright | Mar 03, 2016 |
Printed | Page 608 first paragraph |
"AWTEvent is a subclass of java.awt.EventObject;" should be "... is a subclass of java.util.EventObject;" (i.e. replace "awt" with "util") |
Scott Wright | Feb 23, 2016 |
Printed | Page 615 second to last paragraph |
The constant width text in the third sentence "FocusEventgetOppositeComponent()" has lost the space between the class and method names -- it should be "FocusEvent<space>getOppositeComponent()" |
Scott Wright | Feb 24, 2016 |
Printed | Page 635 code sample |
The Java 1.7 compiler whines about the JComboBox and JList declarations being raw types and also about the JList.getSelectedValues() method in the ActionListener being deprecated. |
Scott Wright | Mar 04, 2016 |
Printed | Page 635 code sample |
When the GUI starts up, no item is selected from the JList, so pressing "Per favore" produces a (slightly) disconcerting "null response". |
Scott Wright | Mar 04, 2016 |
Printed | Page 639 first paragraph |
The first sentence on the page references a "SpinnerCalendarModel" -- was "SpinnerDateModel" intended? |
Scott Wright | Mar 05, 2016 |
Printed | Page 658 code sample |
The JScrollBar only displays values from 0 to 207, despite its "max" being set to 255 -- apparently effective maximum is actually max - extent. So in this example, to have the JScrollBar and JSlider display equivalent ranges, the JScrollBar ought to be initialized as: |
Scott Wright | Mar 07, 2016 |
Printed | Page 894 line 12 from top to page 895, line 13 from top |
The source code published is not the file referred to by the text. The text refers to an XSL stylesheet. However, the printed source code is an XML schema. |
Martin Fluch | Aug 12, 2014 |