A

Admin • 831.35K Points
Coach

Q. What is the result of calling `poll()` on an empty `LinkedList` used as a Queue?

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

Explanation by: Admin
The `poll()` method returns null if the queue is empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.