LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 19

BlockingQueue put and take Answer, explanation & discussion

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

What happens when a producer calls put on a full ArrayBlockingQueue?

  • A The item is dropped
  • B The producer blocks until space becomes available Correct
  • C An exception is thrown
  • D The queue grows
Correct Answer: Option B

take blocks when the queue is empty; offer/poll have non-blocking and timed variants.

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