public synchronized E pop() {if (elementCount == 0) {throw new EmptyStackException();}final int index = --elementCount;final E obj = (E) elementData[index];elementData[index] = null;modCount++;return obj;}
public virtual E pop(){lock (this){if (elementCount == 0){throw new java.util.EmptyStackException();}int index = --elementCount;E obj = (E)elementData[index];elementData[index] = null;modCount++;return obj;}}