A

Admin • 833.24K 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: 30
  • 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.