Tuesday, March 8, 2016

Difference between poll and remove of Queue

The difference between poll() and remove() methods is that:
remove() method will throw NoSuchElementException if the queue is empty. But poll() method will return null if Queue is empty. So we need to use these methods carefully.



No comments:

Post a Comment