What exception is thrown if removeLast() is called on an empty Deque?

  1. NullPointerException
  2. IllegalStateException
  3. NoSuchElementException
  4. IllegalArgumentException
Correct answer NoSuchElementException

Explanation

removeLast() throws NoSuchElementException if the Deque is empty.

Update: Admin added a tag on this question

Topics

By Admin · · 61 views