LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 4

What Future.get() does Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

What does future.get() do if the task has not finished?

  • A Returns null
  • B Blocks until the result is available Correct
  • C Throws immediately
  • D Cancels the task
Correct Answer: Option B

Use get(timeout, unit) to avoid waiting forever.

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