AbstractQueue element() method in Java with examples
The element() method of AbstractQueue retrieves, but does not remove, the head of this queue. Syntax: public E element() Parameters: This method does not accept any parameters. Returns: The method returns the head of the Queue. Exception: The function throws an NoSuchElementException if the queue is