A

Admin • 828.03K Points
Coach

Q. What exception does `element()` throw if the queue is empty?

  • (A) IllegalArgumentException
  • (B) NullPointerException
  • (C) IllegalStateException
  • (D) NoSuchElementException
  • Correct Answer - Option(D)
  • Views: 13
  • Filed under category Java
  • Hashtags: Java Queue

Explanation by: Admin
`element()` throws NoSuchElementException when the queue is empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.