remove

open override fun remove(): E

Retrieves and removes the head of this queue. This method differs from .poll only in that it throws an exception if this queue is empty.

This implementation returns the result of poll unless the queue is empty.

Return

the head of this queue

Throws

if this queue is empty