R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method in Queue removes and returns the head of the queue?

  • (A) pop()
  • (B) poll()
  • (C) top()
  • (D) shift()
  • Correct Answer - Option(B)
  • Views: 10
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`poll()` retrieves and removes the head of the queue, returning 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.