/** * Removes the object at the top of this stack and returns that object. * * @return The object at the top of this stack * @exception EmptyStackException * If this stack is empty. */ public final T pop() { final T top = peek(); remove(size() - 1); return top; }
/** * Removes the object at the top of this stack and returns that object. * * @return The object at the top of this stack * @exception EmptyStackException * If this stack is empty. */ public final Object pop() { final Object top = peek(); remove(size() - 1); return top; }