In a Java Queue, poll() and remove() methods can be used for
removing the head object of Queue. The main difference arises in
the case when Queue is empty().
If Queue is empty then poll() method returns null value. If Queue is
empty then remove() method throws NoSuchElementException.
In a Java Queue, peek() method retrieves the head of Queue but it
does not remove it. If queue is empty then peek() method returns
null value.