Which of the following is a blocking method for retrieving and removing the head?

  1. takeFirst()
  2. pop()
  3. poll()
  4. removeFirst()
Correct answer takeFirst()

Explanation

`takeFirst()` blocks until an element is available in a blocking deque.

Update: Admin added a tag on this question

Topics

By Admin · · 33 views