Multiple choice

Which of the following statements is correct for the methods in queue in Java Collections?

  1. Poll() method retrieves and removes the head of the queue or returns Null if the queue is empty.

  2. Remove() method retrieves and removes the head of the queue or returns Null if the queue is empty.

  3. Poll() method retrieves and removes the head of the queue or throws an exception if the queue is empty.

  4. Remove() method retrieves and removes the head of the queue, but doesn’t return anything if the queue is empty.

  5. Poll() method retrieves the head of the queue or returns Null if the queue is empty.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is the correct choice.