This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests and have Scott Selikoff and Jeanne Boyarsky on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Errata OCP Java SE 11 Programmer II Study Guide, page 679

 
Ranch Hand
Posts: 65
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

Possibly found an errata. The answer in the book on question 12 on page 410, Chapter 7 Concurrency, is B but it's incorrect.

The method signature is: and throws an Interrupted Exception. And in the question mentioned above, the exception is not caught or declared to be thrown!
And that's why answer F should be correct. If the exception is caught or declared, answer B would be correct.

Greetings
Michael
 
Mike Gualeni
Ranch Hand
Posts: 65
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Gualeni wrote:Hello

Possibly found an errata. The answer in the book on question 12 on page 410, Chapter 7 Concurrency, is B but it's incorrect.

The method signature is: and throws an Interrupted Exception. And in the question mentioned above, the exception is not caught or declared to be thrown!
And that's why answer F should be correct. If the exception is caught or declared, answer B would be correct.

Greetings
Michael




Okay, I saw this:

Code fragments: A code fragment is a small section of source code that is presented without its context. Assume that all necessary supporting code exists and that the supporting environment fully supports the correct compilation and execution of the code shown and its omitted environment.


But do I have to assume everywhere if an exception is not caught or declared that a main method with the right throws Exception is surrounded'??
 
author & internet detective
Posts: 40469
821
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
Yes. If you see code that is not in a method, you can assume that all exceptions are handled/declared.
 
And inside of my fortune cookie was this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic