Errata
Please check here often as we will update the errata regularly.
You can either contact us directly (Khalid, Vasily) to report an error or you can post it on the PROGRAMMER CERTIFICATION (OCPJP) FORUM at Coderanch.
On the forum, just create a new thread and designate the subject to be "OCP Java 17 Programmer's Guide", together with the page number in the book.
We monitor the forum for any feedback.
Errata updates:
Date of update | Printing | Pages |
---|---|---|
2023-04-20 | 1st | 1198 |
2023-05-09 | 1st | 1677 |
2023-07-16 | 1st | 29 |
2023-07-21 | 1st | 238 |
2023-08-07 | 1st | 516, 525, 526 |
2023-08-08 | 1st | 518 |
2023-08-25 | 1st | 1501 |
2023-09-04 | 1st | 943 |
2023-09-16 | 1st | 1071 |
Acknowledgements:
Many thanks to the following readers for their diligent observations: Eric Borm, Michael Gualeni, Michael Gualeni, Satish Singh, Ivan Titov.
Errata list:
The errors listed below are ordered according to their page numbers. Each error is labeled with all the printings where the error occurred. E.g. "1st printing" indicates that the error occurred in the first printing, but has been corrected before the second printing, i.e. you won't find this error in the second printing.
Page 29
1st printing, under Chapter Topics in Chapter 2, the word "boolean" is misspelt in the following bullet:
CHANGE:
Overview of primitive data types defined in Java: integral, floating-point, and boolgean
TO:
Overview of primitive data types defined in Java: integral, floating-point, and boolean
Page 238
1st printing, in the section Defining Interfaces:
CHANGE:
The access modifier can be public or private. Lack of an access modifier implies package accessibility.
TO:
The access modifier can be public. Lack of an access modifier implies package accessibility.
Page 516
1st printing, in the last sentence, the name of the non-static field should be nsf2 and not nsf1:
CHANGE:
The static field sf in the class TLCWith2LCS is accessed in the StaticLocal class at (14), but the non-static field nsf1 cannot be accessed, as shown at (13).
TO:
The static field sf in the class TLCWith2LCS is accessed in the StaticLocal class at (14), but the non-static field nsf2 cannot be accessed, as shown at (13).
Page 518
1st printing, in the output from Example 9.12:
CHANGE:
Painter$1$Circle Painter$1$Graph
TO:
Painter$1Circle Painter$1Graph
Page 525
1st printing, the second sentence in the subsection Accessing Local Declarations in the Enclosing Block:
CHANGE:
An anonymous class can only access (effectively) final variables in its enclosing local context, shown both for static fields at (10), (11), and (12), and for instance fields at (13), (14), and (15).
TO:
Local variables in the enclosing non-static method cannot be accessed in any static fields of an anonymous class, whether they are (effectively) final or not, as shown at (10), (11), and (12). An anonymous class can only access (effectively) final local variables in its enclosing local context from its instance fields, as shown at (13), (14), and (15).
Page 526
1st printing, in Example 9.15 (see the new explanation on page 525):
CHANGE:
static int sff1 = fp; // (10) Final param from enclosing method static int sff2 = flv; // (11) Effect. final variable from enclosing method
TO:
// static int sff1 = fp; // (10) Final param from enclosing method // static int sff2 = flv; // (11) Effect. final variable from enclosing method
Page 943
1st printing, in the subsection Querying an Optional:
CHANGE:
<X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X extends Throwable
TO:
<X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X
Page 1071
1st printing, in Example 17.7, logical error in the loop condition of the for(;;) loop:
CHANGE:
time.plus(duration).isBefore(endTimeExclusive);
TO:
time.isBefore(endTimeExclusive);
1st printing, in Example 17.7, the program output is missing a showtime:
CHANGE:
Showtime (PT2H15M): 10:10 Showtime (PT2H15M): 12:25 Showtime (PT2H15M): 14:40 Showtime (PT2H15M): 16:55 Showtime (PT2H15M): 19:10 Closing time: 23:00
TO:
Showtime (PT2H15M): 10:10 Showtime (PT2H15M): 12:25 Showtime (PT2H15M): 14:40 Showtime (PT2H15M): 16:55 Showtime (PT2H15M): 19:10 Showtime (PT2H15M): 21:25 Closing time: 23:00
Page 1198
1st printing, in Figure 19.15:
CHANGE:
«module game»
TO:
«module name»
Page 1501
1st printing, in Figure 23.7:
CHANGE:
CopyOnWriteArrayList<K,V> CopyOnWriteArraySet<K,V>
TO:
CopyOnWriteArrayList<E> CopyOnWriteArraySet<E>
Page 1677
1st printing, answer to Review Question 15.20:
CHANGE:
(b)
TO:
(a)