On the bottom of the copyright page (facing the first page of the table of contents), look for a line such as
1 17
The first number (1 in this example) is the printing number.
In the errata below, we indicate the printing in which the error has been fixed inside square brackets such as [4].
For example, suppose you have the fourth printing. Then you can ignore all reports that are prefixed with [2], [3] or [4]. But you would want to pay attention to all reports that are prefixed with [5] or higher or that have no bracketed prefix at all.
$
symbol...” to “The name of a variable (as well as a method or class) can consist of any letters, digits, and the symbols _ and $. It cannot begin with a digit. The $
symbol...”IntSequence
class provides methods” to “suppose the IntSequence
interface provides methods”Scanner
, the Scanner
class
catches the input exception and closes the resource from which it consumes input. What happens if closing the resource throws an exception? How does this implementation interact with the handling of suppressed
exceptions in the try-with-resources statement?” to “If input fails when using a Scanner
, the Scanner
class
catches the exception and stops reading from the input source. What happens when the scanner is closed, and closing the input source throws an exception? Compare this behavior with the handling of suppressed
exceptions in the try-with-resources statement.”int difference = first.length() < second.length();to
int difference = first.length() - second.length();
Employee[] buttons = stream.toArray(Employee[]::new);to
Employee[] employees = stream.toArray(Employee[]::new);
RandomInt
into a nested class” to “If you turned RandomSequence
into a nested class”m.invoke(obj, "********");
to m.invoke(p, "********");
new String(Files.readAllBytes(path))
to Files.readString(path)
and “Even though Files.readAllBytes
” to “Even though Files.readString
”String contents = new String(Files.readAllBytes( Paths.get("alice.txt")), StandardCharsets.UTF_8);to
String contents = Files.readString(Paths.get("alice.txt"));
String content = new String(Files.readAllBytes(path), charset);to
String content = Files.readString(path, charset);
String content = new String(Files.readAllBytes(path), charset);to
String content = Files.writeString(path, content, charset);Right below, change “or” to “You can write multiple strings with”. Change
Files.write(path, content.getBytes(charset), StandardOpenOption.APPEND);to
Files.writeString(path, content, charset, StandardOpenOption.APPEND);
.map(Matcher::group)to
.map(MatchResult::group)
new Manager("Barney", 105000)
to new Manager("Paul", 105000)
birthday.plus(Duration.ofDays(365))
to birthday.plus(Period.ofDays(365))
ZoneId.getAvailableIds
to ZoneId.getAvailableZoneIds()
java.util.DateFormat
to java.text.DateFormat
TimeStamp.from(instant)
to Timestamp.from(instant)
, timeStamp.toLocalDateTime()
to timestamp.toLocalDateTime()
, and Timezone.getTimeZone(id)
to TimeZone.getTimeZone(id)
. The two last "Classes" entries should be ZoneId
↔ java.util.TimeZone
and Instant
↔ java.nio.file.attribute.FileTime
.today.with(next(w -> getDayOfWeek().getValue() < 6))to
today.with(next(w -> w.getDayOfWeek().getValue() < 6))
String message = MessageFormat("It is now {0,time,short}.", Date.from(Instant.now()));to
String message = MessageFormat.format("It is now {0,time,short}.", Date.from(Instant.now()));
b + 1
and b.add(java.math.BigInteger.ONE)
. Explain the results.”ServiceLoader.load(serviceInterface.class)
to ServiceLoader.load(ServiceInterface.class)
Thanks to Rogerio Brioschi, Chee Cheng, Stephan van Hoof, Grigorii Ivanov, George M Jempty, Narendra Kangralkar, Alina Kirsanova, Lipi C.H. Lee, Ahmad Qatramiz, Campbell Ritchie, Jorge Ruiz-Aquino, KyeongKeun Shin, Dominic So, Koray Tugay, Sébastien Wilmet, and (your name might go here) for their bug reports and suggestions!
Please use this form to report any bugs that you find. Please check the list of known bugs first before you report a bug. Unfortunately, I do not have the time to respond personally to every report, but I do read them all and will post updates to this page. Thank you!