Which method removes and returns the first element in Deque?

  1. pollLast()
  2. pollFirst()
  3. peekFirst()
  4. pop()
Correct answer pollFirst()

Explanation

pollFirst() removes and returns the first element or returns null if empty.

Update: Admin added a tag on this question

Topics

By Admin · · 29 views