LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 3

execute() versus submit() Answer, explanation & discussion

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

What does submit() return that execute() does not?

  • A A Thread
  • B A Future representing the task's result or exception Correct
  • C An int status
  • D Nothing – they are identical
Correct Answer: Option B

With submit, an exception is stored in the Future; with execute it goes to the thread's uncaught-exception handler.

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