Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Errata OCP 17 Developer Study Guide

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

don't know exactly where to post this:

on chapter 2 on "Complement and Negation Operators" there are this lines:



but the actual result should be 1.21 and not  -1.21

I know it's a small thing but I think is good to be corrected.

thank you,
Stefan Banu
 
Greenhorn
Posts: 25
3
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stefan!
The full code is:


On the third line the variable zooTemperature is reassigned to -1.21, as printed on line 4. The fifth line then reassign the variable again, with a double negation. So the result is stil -1.21
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran it again and confirmed I got what Marco (and the book) got.
 
Stefan Banu
Greenhorn
Posts: 17
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, thank you,
my bad.
 
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In the introduction on page xxxiii there is a small typo in my opinion.

"The review questions in each chapter are designed to help you home in..."

should be "...hone in..."

I'm not a native speaker, so my apologies if this was correct and I got it wrong.

Kind regards,
Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Still in the introduction, on page lx, I am wondering about the accuracy of the following statement:

"14. D, E. Line 10 includes an unhandled checked IOException..."

Actually, exactly at line 10 there is nothing wrong according to the Javadoc for BufferedInputStream.
But I have to admit, a lot is going wrong in this excerpt code.
And in the end, it is up to the reader to verify this for a better understanding for the exam.

Kind regards,
Guillaume
 
Marco Olivi
Greenhorn
Posts: 25
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The IOException to be handled is actually on line 11, when a new FileInputStream is created.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:Hi,

In the introduction on page xxxiii there is a small typo in my opinion.

"The review questions in each chapter are designed to help you home in..."

should be "...hone in..."

I'm not a native speaker, so my apologies if this was correct and I got it wrong.

Kind regards,
Guillaume


You are correct. I added it to the errata. Interestingly, it was right in the Java 11 book. And this isn't a part we change so an editor must have misread.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Marco Olivi wrote:The IOException to be handled is actually on line 11, when a new FileInputStream is created.


Agreed. Gave Guillaume the errata credit for finding it and Marco a cow for noting the correction. Thanks to you both!
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Since I'm not sure where to put this, I will continue here.

Although the rules for identifiers on page 35 are clear, the rationale on page 36 in the examples could be more precise.

In particular, instead of
 "@ is not a letter, digit, $ or _"
I would suggest
 "@ is not a letter, digit, currency symbol or _"

The next one is even a bit wrong according to the rules.

Instead of
 "* is not a letter, digit, $ or _"
I would suggest
 "* is not a letter, currency symbol or _"
(digit would not be allowed here)

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

About that last one, I would also propose a similar correction for answer to review question 4 of chapter 1 (page 910).

It would be more accurate in my opinion to say "currency symbol" instead of "dollar sign".

Guillaume
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We actually had currency symbol in our Java 11 book and a reader noticed this was wrong. The following is from the Java Language Specification. The word "currency" doesn't appear in the JLS so we decide to go with $ in the Java 17 book.

It makes no practical effect for the exam. They won't show you an identifier with a euro character or the like.

A "Java letter" is a character for which the method Character.isJavaIdentifierStart(int) returns true.

A "Java letter-or-digit" is a character for which the method Character.isJavaIdentifierPart(int) returns true.

The "Java letters" include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ sign should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.

 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

On page 183, right before the section "Sorting", one can read

"...which is also a way of referring to that tenth element."

to refer to the element at index 10.

What one actually means then is "the eleventh element" (which does not exist).

Guillaume
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Confirmed and added to the errata
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The following is a tiny one in the text and is more for completeness.

In the correction of question 19 for chapter 4 review questions on page 923, I would rather say something like

"This is the case for option A since the element at index 1 of s2 comes first alphabetically."

This makes it clearer in my opinion.

Kind regards.
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

At the top of page 364, the enum value that is mentioned is Season.FALL, while the code (at the bottom of page 363) actually uses Season.WINTER.

Guillaume
 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, all.

I found 2 possible erratas on book OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829.

1) On page 443, in the example the result should be 7 and not 8 on line .

2) In Table 9.6, (page 485) it says . It should be .

Where could I find the whole erratas table for this book?

Kind regards.

László.

 
Marshal
Posts: 28289
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Guillaume Bailly wrote:Hi,

In the introduction on page xxxiii there is a small typo in my opinion.

"The review questions in each chapter are designed to help you home in..."

should be "...hone in..."

I'm not a native speaker, so my apologies if this was correct and I got it wrong.

Kind regards,
Guillaume


You are correct. I added it to the errata. Interestingly, it was right in the Java 11 book. And this isn't a part we change so an editor must have misread.



Old people would use "home in" because that used to be the standard usage. Recently people have started using "hone in" instead. So there's sort of a controversy. You might want to choose a different phrase.

Merriam-Webster
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Good to know Paul, thanks!

Kind regards,
Guillaume
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Fernando László Temesi Villagrán wrote:1) On page 443, in the example the result should be 7 and not 8 on line .


I ran it again and still get 8. Which matches the book. Remember that with composer, the parameter (before) runs first. So 3+1 = 4. Then the instance (after) runs making 4*2 = 8


Fernando László Temesi Villagrán wrote:2) In Table 9.6, (page 485) it says . It should be .


Agreed. This is already in the errata.

Fernando László Temesi Villagrán wrote:Where could I find the whole erratas table for this book?


https://www.selikoff.net/ocp17/
 
Greenhorn
Posts: 12
2
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Guillaume Bailly wrote:Hi,

In the introduction on page xxxiii there is a small typo in my opinion.

"The review questions in each chapter are designed to help you home in..."

should be "...hone in..."

I'm not a native speaker, so my apologies if this was correct and I got it wrong.

Kind regards,
Guillaume


You are correct. I added it to the errata. Interestingly, it was right in the Java 11 book. And this isn't a part we change so an editor must have misread.



The errata item's page reference is currently "xxiiii" instead of the correctly reported "xxxiii".
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ocp17 errata item:
xliv Intro #14 – || should be | Alessandro Putzu 8/22/22
is actually a ocp11 errata item and should read for ocp17:
lvii Intro #30 – || should be |
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I noticed a mistake one page 908 and page 961. On page 908 question 21 says to pick 2 answers, according to page 961 those are B and D. However only answer B is correct.

The explanation on page 961 says that since line D is commented out, the update is lost. However since in the code example a try-with-resources is used on the connection, the connection gets closed. According to page 894, this an autocommit edge case of which the behaviour is undefined, therefor the update might be commited or rolled back. Meaning answer D is wrong, as the update might occur.
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 1, Review Question 5, Option B:
The answer is marked as false. However, if the object created on line 9 is eligible for GC after line 13, isn't it then also eligible for GC after line 14? Or does the System.gc() is interpreted as: the object might have been GCed and therefore might not in all cases be eligible i.e. it might not exist?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, the converted time, is okay?
It looks like that it should be 2:50 and not 12:50. (Chapter 4)

Sorry if this is not the right place to post

2022–06–20T06:50+05:30[Asia/Kolkata]    // GMT 2022–06–20 01:20
2022–06–20T07:50-05:00[US/Eastern]      // GMT 2022–06–20 12:50
 
Marshal
Posts: 79642
380
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 5, page 251 reads in the second last sentence of the page:
We ran rewrite our previous example [...]
and should be:
We can rewrite our previous example [...]
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 6, Review question 14 D looks correct to me, although the answer says wrong. Anyone?
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Luiz Felipe Ribeiro wrote:Hi guys, the converted time, is okay?
It looks like that it should be 2:50 and not 12:50. (Chapter 4)

Sorry if this is not the right place to post

2022–06–20T06:50+05:30[Asia/Kolkata]    // GMT 2022–06–20 01:20
2022–06–20T07:50-05:00[US/Eastern]      // GMT 2022–06–20 12:50



Looks right to me:

The calculation for the US/Eastern time into GMT is: 07:50 - (-05:00) = 12:50

Chapter 4 Page 194.
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 7, Review question 14 Option D, pages 410 & 934. The question uses "non-sealed" and the answers assumes that the question uses "nonsealed" (without the dash).
Looks incorrect to me, making option D correct.

Edit:
I just see this already in the errata.
 
Ranch Hand
Posts: 241
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne/Scott,

I hope you are both well. This is only a minor issue on page 565, last sentence of the section entitled Linking Streams to the Underlying data:

"First, it looks at the source and seeing three elements."

Did you mean to develop the thought process further here?

I'm enjoying the book so far, it is even better than previous editions. I love how the essential information is logically summarised in tables throughout the book. Really, really clear approach to organising the content!

 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manuel Trumm wrote:Chapter 1, Review Question 5, Option B:
The answer is marked as false. However, if the object created on line 9 is eligible for GC after line 13, isn't it then also eligible for GC after line 14? Or does the System.gc() is interpreted as: the object might have been GCed and therefore might not in all cases be eligible i.e. it might not exist?


Yes, you're right. The book assumes the most "restrictive" here (and if it's eligible for GC somewhere in the code, it will always be so later on in the same code).
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manuel Trumm wrote:Chapter 6, Review question 14 D looks correct to me, although the answer says wrong. Anyone?


Notice that if class A is extended by B, then B is a subclass of A.
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:

Manuel Trumm wrote:Chapter 6, Review question 14 D looks correct to me, although the answer says wrong. Anyone?


Notice that if class A is extended by B, then B is a subclass of A.



Ah, I misunderstood "extended by". Thanks!
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 11, page 616, "Basics of Try-with-Resources":

Also, notice that parentheses are used to list those resources, and semicolons are used to separate the declarations. This works just like declaring multiple indexes in a for loop.


Multiple indexes in for loop are separated by commas, while multiple resources are separated by semicolons. In addition, the type can be declared only once in a for loop.
Hence I don't understand the "works just like".
 
Manuel Trumm
Greenhorn
Posts: 12
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 12, page 711, Summary:

The exports directive specifies that a package should be accessible outside the module. It can optionally restrict that export to a specific package.


That should be "to a specific module"?
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manuel Trumm wrote:The errata item's page reference is currently "xxiiii" instead of the correctly reported "xxxiii".


Oops. Fixed

Manuel Trumm wrote:The ocp17 errata item:
xliv Intro #14 – || should be | Alessandro Putzu 8/22/22
is actually a ocp11 errata item and should read for ocp17:
lvii Intro #30 – || should be |


Agreed. Fixed

Artuur Oerlemans wrote:Hi,
I noticed a mistake one page 908 and page 961. On page 908 question 21 says to pick 2 answers, according to page 961 those are B and D. However only answer B is correct.


The book has two B and D. The errata says give yourself credit for D. So it is inconsistent but the book does match itself.

Manuel Trumm wrote:Chapter 1, Review Question 5, Option B:
The answer is marked as false. However, if the object created on line 9 is eligible for GC after line 13, isn't it then also eligible for GC after line 14? Or does the System.gc() is interpreted as: the object might have been GCed and therefore might not in all cases be eligible i.e. it might not exist?


The intent was first eligible for GC. I like your justification on why it isn't wrong though . We did it that way in our Java 8 and 11 books. That said, you did find a good edge case of interpretation. have a cow. I made a note to see if want to to add "first" next time.

Luiz Felipe Ribeiro wrote:Hi guys, the converted time, is okay?
It looks like that it should be 2:50 and not 12:50. (Chapter 4)

Sorry if this is not the right place to post

2022–06–20T06:50+05:30[Asia/Kolkata]    // GMT 2022–06–20 01:20
2022–06–20T07:50-05:00[US/Eastern]      // GMT 2022–06–20 12:50


I prefer separate threads because it makes it easier to track/reply. But I'd rather hear from readers even if it is in one large thread. I don't get 2:50 when I run it. What locale are you in. [edit: I see it works for Manuel too]
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manuel Trumm wrote:Chapter 5, page 251 reads in the second last sentence of the page:
We ran rewrite our previous example [...]
and should be:
We can rewrite our previous example [...]


Agreed and added to the errata

Manuel Trumm wrote:Chapter 6, Review question 14 D looks correct to me, although the answer says wrong. Anyone?


It's backwards Option D is. "If class A is extended by B, then B is a superclass of A"
If class A is extended by B means

This makes A the superclass of B which is the opposite of what option D says.

Edit: Guillaume explained this in the thread (I'm going in order)

T Vergilio wrote:Hi Jeanne/Scott,

I hope you are both well. This is only a minor issue on page 565, last sentence of the section entitled Linking Streams to the Underlying data:

"First, it looks at the source and seeing three elements."

Did you mean to develop the thought process further here?


Hmm. It was like that in the Java 11 book too. I think we meant to say "sees" and not "seeing". I'll put it in our list for the next edition.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manuel Trumm wrote:Chapter 11, page 616, "Basics of Try-with-Resources":

Also, notice that parentheses are used to list those resources, and semicolons are used to separate the declarations. This works just like declaring multiple indexes in a for loop.


Multiple indexes in for loop are separated by commas, while multiple resources are separated by semicolons. In addition, the type can be declared only once in a for loop.
Hence I don't understand the "works just like".


Conceptually having multiple things

Manuel Trumm wrote:Chapter 12, page 711, Summary:

The exports directive specifies that a package should be accessible outside the module. It can optionally restrict that export to a specific package.


That should be "to a specific module"?


Yup! Added to the errata
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic