• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Errata for OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide - Chapter 6

 
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
Page 302, just a minor.

Last sentence in the Real World Scenario box:

Since Closeable meets the requirements for AutoCloseable, it started implementing AutoCloseable when the latter was introduced.



Technically, it started extending AutoCloseable because Closeable is an interface.
 
T Vergilio
Ranch Hand
Posts: 241
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And on page 314, 3rd paragraph of the Summary:

The variable in a multi-catch expression is effectively final.



Should be implicitly final.

An exception parameter of a multi-catch clause is implicitly declared final, so will never occur as the left-hand operand of an assignment operator, but it is not considered effectively final.


source: http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.1
 
T Vergilio
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
page 561, answer to question 13:

Since a multi-catch is used, the variable in the catch block is effectively final and cannot be reassigned.


Same issue, shouldn't it be implicitly final?
 
T Vergilio
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
I just noticed that the examples in the Rethrowing Exceptions section of Chapter 6 (starting on page 305) treat DateTimeParseException as if it's a checked exception.
But DateTimeParseException extends DateTimeException, which extends RuntimeException.

On page 305:

Suppose that we have a method that declares two checked exceptions:



On page 306:

(...) we need to handle or declare those two exception types.



and so on.

Perhaps DateTimeParseException could be swapped for ParseException in the examples?
 
author & internet detective
Posts: 41860
908
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
Sorry, this one slipped through the cracks.

page 302 - agreed and logged
page 314 and 561 - interesting. I wasn’t aware of that distinction. It makes sense though. It’s a hacky type of final . Cow for teaching me something!

The DateTimeException was noticed here. You noticed it first, but I logged it first from that thread.
 
T Vergilio
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
Thanks for checking these. And thanks for the cow! To be honest, I didn't even know what effectively final was before I read your book. It's all an ongoing learning process
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic