Which method waits if necessary to insert an element at the front of a deque?

  1. addFirst()
  2. offerFirst()
  3. putFirst()
  4. enqueueFirst()
Correct answer putFirst()

Explanation

`putFirst()` is a blocking method used in blocking deques like LinkedBlockingDeque.

Update: Admin added a tag on this question

Topics

By Admin · · 28 views