Code example for Queue

Methods: element

    return delegate().peek();
  public E element() { 
    return delegate().element();
   * A sensible definition of {@link #offer} in terms of {@link #add}. If you 
   * override {@link #add}, you may wish to override {@link #offer} to forward 
   * to this implementation. 
   * @since 7.0 
  @Beta protected boolean standardOffer(E e) {
    try { 
      return add(e);
    } catch (IllegalStateException caught) {
      return false; 
Experience pair programming with AI  Get Codota for Java