difference between poll and remove code example
Example: queue poll vs remove
public E remove() {
E x = poll();
if (x != null)
return x;
else
throw new NoSuchElementException();
}
public E remove() {
E x = poll();
if (x != null)
return x;
else
throw new NoSuchElementException();
}