This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
  • 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: 238
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 238
5
  • Mark post as helpful
  • send pies
  • 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: 238
5
  • Mark post as helpful
  • send pies
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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: 238
5
  • Mark post as helpful
  • send pies
  • 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
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!