difference remove and poll 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();
}