java.util

Class EmptyStackException

Implemented Interfaces:
Serializable

public class EmptyStackException
extends RuntimeException

Thrown by methods in the Stack class to indicate that the stack is empty.
Since:
JDK1.0
See Also:
Stack, Serialized Form

Constructor Summary

EmptyStackException()
Constructs a new EmptyStackException with null as its error message string.

Method Summary

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

EmptyStackException

public EmptyStackException()
Constructs a new EmptyStackException with null as its error message string.
Usages and Demos :

View More Examples of EmptyStackException()
   1:         if (top == -1)
   2:             throw new EmptyStackException();
   3:         Object temp = stack[top];
   4:         stack[top] = null;
   5:         return temp;

View Full Code Here
   1:         {
   2:             throw new EmptyStackException();
   3:         }
   4:         ...
   5:         {
   6:             throw new EmptyStackException();
   7:         }
   8: 
   9:         return elements.getLast();

View Full Code Here
   1:         if (Size == 0)
   2:             throw new EmptyStackException();
   3:         
   4:         ...
   5:         if (Size == 0)
   6:             throw new EmptyStackException();
   7:         
   8:         return get(Size - 1);
   9:     }

View Full Code Here
   1:     if (len == 0)
   2:         throw new EmptyStackException();
   3:     return elementAt(len - 1);
   4:     }

View Full Code Here
   1:     if (len == 0)
   2:         throw new java.util.EmptyStackException();
   3:     return elementAt(len - 1);
   4:     }

View Full Code Here