Offer,add differences:
Some queues have a size limit, so if you want to add a new item to a full queue, the extra items will be rejected.
At this point the new offer method will work. It does not throw a unchecked exception to the call to the Add () method, but only gets the false returned by the offer ().
Poll,remove differences:
Both the Remove () and poll () methods remove the first element from the queue. Remove () behaves like the version of the Collection interface,
However, the new poll () method does not throw an exception when called with an empty collection, only returns NULL. Therefore, the new method is more suitable for situations prone to abnormal conditions.
Peek,element differences:
Element () and peek () are used to query the elements on the head of the queue. Similar to the Remove () method, Element () throws an exception when the queue is empty, and peek () returns null
Remove/poll, Add/offer, element/peek differences in Java queue