src/share/classes/java/util/Stack.java
Print this page
*** 73,83 ****
* Removes the object at the top of this stack and returns that
* object as the value of this function.
*
* @return The object at the top of this stack (the last item
* of the <tt>Vector</tt> object).
! * @exception EmptyStackException if this stack is empty.
*/
public synchronized E pop() {
E obj;
int len = size();
--- 73,83 ----
* Removes the object at the top of this stack and returns that
* object as the value of this function.
*
* @return The object at the top of this stack (the last item
* of the <tt>Vector</tt> object).
! * @throws EmptyStackException if this stack is empty.
*/
public synchronized E pop() {
E obj;
int len = size();
*** 91,101 ****
* Looks at the object at the top of this stack without removing it
* from the stack.
*
* @return the object at the top of this stack (the last item
* of the <tt>Vector</tt> object).
! * @exception EmptyStackException if this stack is empty.
*/
public synchronized E peek() {
int len = size();
if (len == 0)
--- 91,101 ----
* Looks at the object at the top of this stack without removing it
* from the stack.
*
* @return the object at the top of this stack (the last item
* of the <tt>Vector</tt> object).
! * @throws EmptyStackException if this stack is empty.
*/
public synchronized E peek() {
int len = size();
if (len == 0)