A

Admin • 828.43K Points
Coach

Q. Which method removes and returns the first element, throwing an exception if empty?

  • (A) pollFirst()
  • (B) pop()
  • (C) removeFirst()
  • (D) peekFirst()
  • Correct Answer - Option(C)
  • Views: 12
  • Filed under category Java
  • Hashtags: Java Deque

Explanation by: Admin
`removeFirst()` throws NoSuchElementException if the Deque is empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.