On the bottom of the copyright page (facing the first page of the table of contents), look for a line such as “First printing, December 2015”. 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.

toinformit.com/register and log in"
to
"To start the registration process, go to informit.com/register and log in"javac 9.0.4 to javac 11.0.1Version 9.0.1 to Version 11.0.1generator variable:” to “You get a list of all methods that you can invoke with the Math class:”n is negative.” to “Except, of course, when n is odd and negative.”empty and blank to isEmpty and isBlank.startsWith/endsWith methods, change “returns true if the string starts or ends with suffix.” to “returns true if the string starts with prefix or ends with suffix.”http://docs.oracle.com/javase/9/docs/api to https://docs.oracle.com/en/java/javase/11/docs/apijdk-9-docs to jdk-11-docsPackageText to PackageTest (2x) in the directory tree ├─ versions
├─ 9
│ ├─ Application.class
│ └─ BuildingBlocks.class
└─ 10
└─ BuildingBlocks.class
to
└─ versions
├─ 9
│ ├─ Application.class
│ └─ BuildingBlocks.class
└─ 10
└─ BuildingBlocks.class
void setAccessible(boolean flag)LocalDate but not final. If you form a Holiday subclass, there is no method that can turn a holiday into a nonholiday.”Objects.equals to Object.equalsInteger::valueOf(x) to Integer.valueOf(x) and Integer::sum(x, y) to Integer.sum(x, y)new LocalDate to LocalDate.of (2x)requireNonNullOrElse to requireNonNullElse, requireNonNullOrElseGet to requireNonNullElseGetComparator.comparing(Person::getMiddleName(), Comparator.nullsFirst(. . .)) to Comparator.comparing(Person::getMiddleName, Comparator.nullsFirst(. . .))— that is, no parentheses after getMiddleNameouter” to “by calling it outer”—italic, not monospaceMETA-INF/services directory whose name matches the fully qualified class name.”
to
“Now add the names of the classes to a UTF-8 encoded text file in a file in the META-INF/services directory whose name matches the fully qualified interface name.”String readData(BufferedReader in) throws FileFormatExceptionto
String readData(Scanner in) throws FileFormatException
The default configuration file is located at
conf/logging.properties
(or at jre/lib/logging.properties prior to Java 9).
to
The default configuration file is located at
jdk/conf/logging.properties (or at jre/lib/logging.properties prior to Java 9).
/opt/jdk-9.0.1/lib/modules to /opt/jdk-11.0.1/lib/modulespublic static <T extends Throwable> void d
{
do work
}
to
public static <T extends Throwable> void doWork(T t) throws T // OK
{
try
{
do work
}
Logger.global.info(. . .); to Logger.getGlobal().info(. . .);min method” to “a better
job with the minmax method”. Change
public static <T extends Comparable<T>> T min(T[] a)to
public static <T extends Comparable<T>> Pair<T> minmax(T[] a)and
public static <T extends Comparable<? super T>> T min(T[] a) . . .to
public static <T extends Comparable<? super T>> Pair<T> minmax(T[] a)
ArrayQueue (or ArrayDeue in some printings) to ArrayDequejava.util.List, change the last bullet from static <E> Set<E> of(E... elements) to static <E> List<E> of(E... elements)"9.0.1" to "11.0.1"java.util.preferences to java.util.prefsnode.put("image", image);
to
if (image != null) node.put("image", image);
private var to private Locke.g. /opt/jdk-9-src to e.g. /opt/jdk-11-srcU searchKeys(long threshold, BiFunction<? super K, ? extends U> f) U searchValues(long threshold, BiFunction<? super V, ? extends U> f) U search(long threshold, BiFunction<? super K, ? super V,? extends U> f) U searchEntries(long threshold, BiFunction<Map.Entry<K, V>, ? extends U> f)to
U searchKeys(long threshold, Function<? super K, ? extends U> f) U searchValues(long threshold, Function<? super V, ? extends U> f) U search(long threshold, BiFunction<? super K, ? super V,? extends U> f) U searchEntries(long threshold, Function<Map.Entry<K, V>, ? extends U> f)(i.e. 3x drop
Bi)values.parallelSort(values.length / 2, values.length);to
Arrays.parallelSort(words, words.length / 2, words.length);
Integer result = task.get(); to Integer result = futureTask.get();public void CompletableFuture<String> to public CompletableFuture<String>builder.redirectIO()
to make this setting for all three streams” to “Call builder.inheritIO()
to make this setting for all three streams”process.waitfor(delay, TimeUnit.SECONDS) to process.waitFor(delay, TimeUnit.SECONDS)—an uppercase F in waitForProcess.current() to ProcessHandle.current()
new String(Files.readAllBytes to Files.readString and remove the subsequent , StandardCharsets.UTF_8)wordList.remove(s), changing words.forEach(s -> if (s.length() < 12) wordList.remove(s)); to words.forEach(s -> {if (s.length() < 12) wordList.remove(s);}); locales = Stream.of(Locale.getAvailableLocales());var din = new DataInputStream(
pbin = new PushbackInputStream(
new BufferedInputStream(
new FileInputStream("employee.dat")))); to
var pbin = new PushbackInputStream(
new BufferedInputStream(
new FileInputStream("employee.dat")));
var din = new DataInputStream(pbin); PrintWriter(Writer out) to PrintWriter(OutputStream out)var content = new String(Files.readAllBytes(path), charset);to
var content = Files.readString(path, charset);
Employee[] readData(BufferedReader in)to
Employee[] readData(Scanner in)
public void readExternal(ObjectInputStream in)
throws IOException, ClassNotFoundException;
public void writeExternal(ObjectOutputStream out)
throws IOException;
to
public void readExternal(ObjectInput in)
throws IOException, ClassNotFoundException;
public void writeExternal(ObjectOutput out)
throws IOException;
readAllBytes followed by” to “As already mentioned in Section 2.1.6, you can read the content of a text file as”. Replace the code line that follows with
var content = Files.readString(path, charset)Two times, change
Files.write(path, content.getBytes(charset)to
Files.writeString(path, content, charsetand, for consistency, change
Files.write(path, lines);to
Files.write(path, lines, charset);
static String readString(Path path, Charset charset)static Path write(Path path, String contents, Charset charset, OpenOption... options)static FileVisitResult postVisitDirectory(T dir, BasicFileAttributes attrs)to
static FileVisitResult postVisitDirectory(T dir, IOException exc)
get(byte[], int offset, int length)to
get(byte[] bytes, int offset, int length)
0 = mark = position = limit = capacityto
0 ≤ mark ≤ position ≤ limit ≤ capacity
String match = input.group(); to String match = matcher.group();URL u = . . .; Document doc = builder.parse(u);to
URL u = . . .; Document doc = builder.parse(u.toString());
</database> to </head>XPathEvaluationResult.XPathResultType.NODESET to XPathEvaluationResult.XPathResultType.NODEXPath newXpath() to XPath newXPath()hyperlinks links to hyperlinks * @param drawingWidth the width of the drawing in pixels
* @param drawingHeight the width of the drawing in pixels
Insert the following lines after line 72
* @param doc the document to be written
* @param filename the name of the destination file
* Uses StAX to write an SVG document with a random drawing.
* @param drawingWidth the width of the drawing in pixels
* @param drawingHeight the width of the drawing in pixels
* @param filename the name of the destination file
javax.xml.stream.XMLOutputFactory, change the bullets
XMLStreamWriter createXMLStreamWriter(OutputStream in) XMLStreamWriter createXMLStreamWriter(OutputStream in, String characterEncoding) XMLStreamWriter createXMLStreamWriter(Writer in) XMLStreamWriter createXMLStreamWriter(Result in)to
XMLStreamWriter createXMLStreamWriter(OutputStream stream) XMLStreamWriter createXMLStreamWriter(OutputStream stream, String encoding) XMLStreamWriter createXMLStreamWriter(Writer writer) XMLStreamWriter createXMLStreamWriter(Result result)
000</salary> to 000.0</salary> (3x)SELECT Books, Books.Publisher_Id, Books.Price, Publishers.Name, Publishers.URLto
SELECT Books.Title, Books.Publisher_Id, Books.Price, Publishers.Name, Publishers.URL
SELECT Books.Price, Booksto
SELECT Books.Price, Books.Title(3x)
long toSeconds(). Change
long to(Days|Hours|Minutes|Seconds|Millis|Nanos)Part()to
long toDaysPart()Change
Instant to Duration (3x) and “an instant” to “a duration” Instant” to “yields a LocalDate that is the given amount away from this LocalDate. ”LocalDate” to “yields a Period”Instant” to “yields a LocalTime that is the given amount away from this LocalTime. ”Instant” to “yields a ZonedDateTime that is the given amount away from this ZonedDateTime. ”dateFormat/DateTimeFormatterTest.javabuttons to parse the text field contents, and a "lenient" check box to and buttons to parse the text field contentsstatic DateTimeFormatter ofLocalizedDate(FormatStyle dateStyle, FormatStyle timeStyle)to
static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle)
SimpleGreeter class” to “the
JavaScript Greeter class”* @param cg the class(loader, className, cl, pd, data) -> to
new ClassFileTransformer() {
public byte[] transform(ClassLoader loader, String className, Class<?> cl,
ProtectionDomain pd, byte[] data) throws IllegalClassFormatException
and add another } to });.ch15.sec04 to v2ch09.requiremodsufficient module succeeds, a requisite module fails, or the end of the module list is reached. required and requisite modules succeed, or if none
of them were executed, if at least one sufficient or optional module succeeds.SimpleLoginModule required pwfile="password.txt";to
SimpleLoginModule required pwfile="jaas/password.txt";
javac jaas/*.java jar cvf login.jar jaas/JAAS*.class jaas/Simple*.class jar cvf action.jar jaas/SysPropAction.classand
java -classpath login.jar:action.jar \ -Djava.security.policy=jaas/JAASTest.policy \ -Djava.security.auth.login.config=jaas/jaas.config \ jaas.JAASTest
public SimplePrincipal(String descrAndValue)
{
String[] dv = descrAndValue.split("=");
this.descr = dv[0];
this.value = dv[1];
}
keytool -importcert -keystore cindy.certs -alias alice -file acmeroot.pemto
keytool -importcert -keystore cindy.certs -alias acmeroot -file acmeroot.pem
String getStringValue() to String getStringValue(int index)@param the class to be described to @param c the class to be describedointCount to pointCountTEXT_HML_HOST to TEXT_HTML_HOSTprintf("Hello, Native World!\n");javah to javac -h id_a = (*env)->GetFieldID(env, cls, "a", ". . ."); to id_a = (*env)->GetFieldID(env, class_X, "a", ". . .");ps.print(str) to out.print(str)PasswordField extend TextFieldtask.setOnFailed(event -> status.setText("Failed due to ") + task.getException());
to
task.setOnFailed(event -> status.setText("Failed due to " + task.getException()));
Thanks to Carlos Eduardo Villanueva Altuna, Mark Ayling, Jessica Cunningham, Dariusz Daćko, Inge Frissen, Pavlo Gotsonoga, Martin Harrigan, Michael Kaelbling, Stephen Kalinin, Daniel King, Oleksii Klochko, Suresh Kumar, Kendrew Lau, Qiang Li, Ke Ma, Irene Mitin, Marv Mollnow, Sy Pham, Ivan Ponomarev, Cesar Rocha, Jinkai Ruan, Eric Rybarczyk, Mark Summerfield, Vyacheslav Usov, Semyon Vasilkov, Matthieu Vincenten, Andy Walsh, Eric Wang, Piotr Winiarek, Phuoc Dong Xuai, Henry Yu, Hongyuan Zhang, Wei Zhang, and (your name might go here) for their bug reports!
If you have found another bug in the book or in our code that is not mentioned in this bug list or the Core Java FAQ , then please send a report. Unfortunately, I cannot reply personally to each report, but I do read all your comments.