• 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Sybex CSG 11: Possible Erratum in the OCP Java SE 11 Developer Complete Study Guide

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 757 of the study guide, just before the last code segment furnished on this page, the following remark is made: “Keep in mind that suppressed exceptions apply only to exceptions thrown in the try clause.” However, in the third paragraph of the Summary section on page 787 of the study guide, the following remark is made: “A suppressed exception occurs when more than one exception is thrown, often as part of a finally block or try-with-resources close() operation.

It is clear to me how, going by the definition of a suppressed exception provided in the study guide, a suppressed exception may be thrown by a try-with-resources block; this happens when the invocation of a close() method in the try-with-resources’ implicit/hidden finally block throws an exception, in addition to the exception thrown in the try-with-resources block.

However, it is not clear to me how, again going by the definition of a suppressed exception provided in the study guide, a suppressed exception may be thrown by a finally block other than a try-with-resources’ implicit/hidden finally block. The fact that a similar and related remark, on page 788 of the study guide, has already been confirmed to be an erratum serves to strengthen my opinion that a suppressed exception may not be thrown by a finally block other than a try-with-resources’ implicit/hidden finally block. This is very simply because a suppressed exception applies only to exceptions thrown in the try clause and an exception thrown by a finally block, other than a try-with-resources’ implicit/hidden finally block, does not meet this definition.
 
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
ScroogeXHTML - a fast and small RTF to HTML5 and XHTML converter library
https://coderanch.com/t/742149/ScroogeXHTML-RTF-HTML-XHTML-converter
reply
    Bookmark Topic Watch Topic
  • New Topic