public class ArrayStack { public void push (E e){ if (size() == theStack.length) grow (); theStack [++ top]=e; } public E peek(){ return theStack[top]; } public void pop (){ top --; } private E [] theStack; private int top; ... }