Code example for ArrayDeque

Methods: peekFirst

0
    return this.size;
  } 
 
  public E peek() 
  { 
    return this.array.peekFirst();
  } 
 
  public E pop() 
  { 
    this.size--;
    return this.array.removeFirst();
  } 
 
  public E push(E item)
  { 
    while (this.size >= this.capacity) {
      this.array.removeLast();
      this.size--;
    }