LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 5

Exceptions thrown by a submitted task Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 5 Back to Exercise

A Callable throws NumberFormatException. What does future.get() throw?

  • A NumberFormatException
  • B ExecutionException whose cause is the NumberFormatException Correct
  • C Nothing
  • D InterruptedException
Correct Answer: Option B

getCause() gives the original exception.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links