Queue interface poll() vs remove() method.


Both methods removes the head of the queue and return the same element, but main difference is that poll() method return null if we call it on empty queue and remove method throw the Exception , and head element depends upon the implementation of queue policy (If implement Comparator or Comparable).