LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 6

shutdown() versus shutdownNow() Answer, explanation & discussion

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

Which statement is correct?

  • A shutdown kills running tasks
  • B shutdown lets queued and running tasks finish but accepts no new ones; shutdownNow interrupts running tasks and returns the queued ones Correct
  • C shutdownNow waits for all tasks
  • D Both are the same
Correct Answer: Option B

awaitTermination waits for the pool to finish.

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