• 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
  • Tim Cooke
  • Ron McLeod
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Report potential error : get method on future throw Checked Exception

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Book : Java OCP 17 Developer Complete Study Guide

Hey everyone, there is nothing about this in the book, and question 4 in review questions seems to have the wrong answer , the book answer is B-C but there is no catch for the future get method so it should be B-C-E?
and someone could please give me the link to a updated version of corrected mistakes?
Screenshot_2.png
[Thumbnail for Screenshot_2.png]
 
Master Rancher
Posts: 5250
85
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rodrigo Morais wrote:but there is no catch for the future get method so it should be B-C-E?


Well, the code snippet shown doesn't show any enclosing method or class.  Depending where this code is inserted, it certainly can compile, or not.  We're supposed to assume that when they don't show a full class and method, those parts can be whatever they need to be to make the code compile.  The enclosing method could either have a try/catch, not shown, or it could declare that it throws the appropriate Exception(s).  We don't know or care.  We just assume that whatever issues exist, they are in the code shown, not outside that code.
 
Author
Posts: 311
13
Scala IntelliJ IDE Netbeans IDE Python Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exam objectives (they call it "topics") noted on the page:
https://education.oracle.com/ouexam-pexam_1z0-830/pexam_1Z0-830
includes text "Assume the following" which sets out to explain the assumptions you should make when answering these exam questions.

I wrote that text some years ago, but the essence is exactly as Mike indicates

 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic