1: public T pop() 2: { 3: checkInitialization(); 4: if (isEmpty()) 5: throw new EmptyStackException(); 6: else 7: { 8: T top = stack[topIndex]; 9: stack[topIndex] = null; 10: topIndex--; 11: return top; 12: } // end if 13: } // end pop 14: // Version 4.0