text: 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;}