1: public T peek() 2: { 3: if (isEmpty()) 4: throw new EmptyStackException(); 5: else 6: return topNode.getData(); 7: } // end peek 8: // Version 4.0