This method of the Queue Class removes an object from the head of the queue.
public synchronized Object nextElement();
Returns true if the object was successfully removed; otherwise, returns false.
NoSuchElementException if the queue is empty.