Source of 6.11.java


  1: // @author Frank M. Carrano, Timothy M. Henry
  2: // @version 5.0
  3: public T pop()
  4: {
  5:    checkIntegrity();
  6:    if (isEmpty())
  7:       throw new EmptyStackException();
  8:    else
  9:    {
 10:       T top = stack[topIndex];
 11:       stack[topIndex] = null;
 12:       topIndex--;
 13:       return top;
 14:    } // end if
 15: } // end pop