Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errata for OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide - page 220  RSS feed

 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Extra comment
Code:



It seems to me (after running this piece of code on my machine) that there's an extra comment ("//") here.



2) The output in the book doesn't match with the output on my machine:

In the book:
"class. java.util.HashMap"
and
"class. java.util.TreeMap"

On my machine:
"class java.util.HashMap"
and
"class java.util.TreeMap"

P.S.: All the text is from the Amazon Kindle version of the book.
My JDK is v.1.8.0_91 from Oracle
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim,
1) True. It still compiles though . I've added it to our private list. While it certainly isn't what we intended, it's not an errata per se
2) Added the typo/stray character to the errata list.

Thanks.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 224
It looks like a typo:

"The most common functional interfaces are Supplier, Consumer, Function, and Predicate. There are also binary versions and primitive versions of many of these methods."

It seems to me that the author meant "interfaces" rather than "methods".
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 230, review question #14 - explanation

The explanation says: "(...) Line 7 is where it all falls apart. Converting from a double to an int would require a cast inside the lambda."

After testing this piece of code on my machine it seems to me that for this line to compile one also needs to change "mapToInt" to "mapToObj".
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:Page 224
It looks like a typo:

"The most common functional interfaces are Supplier, Consumer, Function, and Predicate. There are also binary versions and primitive versions of many of these methods."

It seems to me that the author meant "interfaces" rather than "methods".

It's both the methods and interfaces that have binary/primitive versions. A FunctionalInterface is kind of a "function" of the single abstract method in it. It would have probably been clearer to say interfaces or interfaces/methods though. So yes, you are correct.

Tim Moroz wrote:Page 230, review question #14 - explanation

The explanation says: "(...) Line 7 is where it all falls apart. Converting from a double to an int would require a cast inside the lambda."

After testing this piece of code on my machine it seems to me that for this line to compile one also needs to change "mapToInt" to "mapToObj".

You are correct. That would be a secondary error. After casting, you would then need another change.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure, but it seems to me that this comment shouldn't be here.
Page 250:

Correct if I'm wrong please. As far as I know you make such a comment in the code only when it outputs something.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:Correct if I'm wrong please. As far as I know you make such a comment in the code only when it outputs something.

It's intentional. The comment is there to show what the variable represents to make it easier to follow the code.
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.On page 239.İn the "Finding a Time Zone" frame.At the end tab.
"Try the country name or city name. Or you can print
everything and look though that."

it should be as below

"Try the country name or city name. Or you can print
everything and look through that"
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javid Azimli wrote:Hi.On page 239.İn the "Finding a Time Zone" frame.At the end tab.
"Try the country name or city name. Or you can print
everything and look though that."

it should be as below

"Try the country name or city name. Or you can print
everything and look through that"

Agreed. Thank you for noticing the one character error.
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you're welcome
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My name wasn't mentioned as reporter in errata list.It's empty.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javid Azimli wrote:My name wasn't mentioned as reporter in errata list.It's empty.

Fixed. I hand edit the HTML On the page because wordpress table editing "leaves something to be desired". I had entered both the URL of this thread and your name in that cell. I must have had a misplaced HTML tag which it cleaned up on save.
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:
Javid Azimli wrote:My name wasn't mentioned as reporter in errata list.It's empty.

Fixed. I hand edit the HTML On the page because wordpress table editing "leaves something to be desired". I had entered both the URL of this thread and your name in that cell. I must have had a misplaced HTML tag which it cleaned up on save.


İ understood.Thanks.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw that it has been noted already that DateTimeException is not a checked exception in the chapter 6 and it's recommended to "Pretend it is for the purposes of this chapter as the examples misuse it."
But my message is about DateTimeParseException in the "Exam Essentials".

Page 314:

DateTimeParseException, IOException, and SQLException are common checked exceptions.


DateTimeParseException is an unchecked exception.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True. I've added it to the original errata.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne!

It seems I've found some more errata

page 347 in 2 pieces of code:

and


It seems to me that in both cases there should be MINUTES because TimeUnit class doesn't have the 'MINUTE' constant (Sorry for using 'should', it's a really convenient word...)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:
It seems I've found some more errata

page 347 in 2 pieces of code:

Agreed and logged. Interestingly we got it right on the previous page!

ps - it is ok to say "should". I think that underline is there to raise awareness of incorrect use of the word.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 370:
Many common streams including map(), forEach(), and filter() can be processed independently, although order is never guaranteed.


It seems to me that "many common stream operations" would fit better, wouldn't it?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:Page 370:
Many common streams including map(), forEach(), and filter() can be processed independently, although order is never guaranteed.


It seems to me that "many common stream operations" would fit better, wouldn't it?

Yeah. Now you are just nitpicking .
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pages 410-411

Output of main method in ReadFileInformation class:

When path points to a valid file:


and

when path points to a valid directory:


It seems that these two lines should be swapped to be consistent with the code.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:It seems that these two lines should be swapped to be consistent with the code.

Good eye! Have a cow.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems I found a problem on this page: https://www.selikoff.net/java-ocp-8-programmer-ii-study-guide/

There's a row between pages 442 and 456 and the value in the column "Page" is the following:
various/td>
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:It seems I found a problem on this page: https://www.selikoff.net/java-ocp-8-programmer-ii-study-guide/

There's a row between pages 442 and 456 and the value in the column "Page" is the following:
various/td>

Thanks. Fixed. As you can "see", I edit that page in raw HTML.
 
Tim Moroz
Greenhorn
Posts: 12
1
IntelliJ IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that this is a nitpicking, but hope that at least it's worth of adding to your private list:
Page 483:
(...) to verify that is has been updated.

to verify that IT has been updated.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37051
507
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moroz wrote:I suspect that this is a nitpicking, but hope that at least it's worth of adding to your private list:
Page 483:
(...) to verify that is has been updated.

to verify that IT has been updated.

Thanks Tim. Added to the public errata list. It's legitimately wrong so errata. (Granted minor typo/grammar, but still wrong.) The things on our private list are things that "aren't quite wrong, but could be clearer".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!