Provides a LIFO (last-in-first-out) storage.
| Method Summary | |
boolean |
isEmpty()
Tells whether this stack contains an object. |
Object |
pop()
Provides the top-object of this stack and removes it from the stack. |
void |
push(Object o)
Adds a new object at the top of this stack. |
Object |
top()
Provides the top-object of this stack without removing it. |
| Method Detail |
public boolean isEmpty()
true, iff this stack does not contain
any objectpublic void push(Object o)
o - the object to be stored in this stack
public Object top()
throws EmptyStackException
EmptyStackException - if isEmpty()
public Object pop()
throws EmptyStackException
EmptyStackException - if isEmpty()