Which method removes and returns the last element of a Deque?

  1. pop()
  2. pollLast()
  3. removeFirst()
  4. peekLast()
Correct answer pollLast()

Explanation

pollLast() removes and returns the last element or returns null if empty.

Update: Admin added a tag on this question

Topics

By Admin · · 34 views