A

Admin • 830.13K Points
Coach

Q. What happens when you call `remove()` on an empty queue?

  • (A) Returns null
  • (B) Throws NoSuchElementException
  • (C) Throws NullPointerException
  • (D) Does nothing
  • Correct Answer - Option(B)
  • Views: 12
  • Filed under category Java
  • Hashtags: Java Queue

Explanation by: Admin
`remove()` throws NoSuchElementException if the queue is empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.