T - The element typepublic interface Stack<T>
extends java.util.Collection<T>
java.util.
The iteration order of the elements is (typically, but not necessarily) least-recently-added to most-recently-added.
| Modifier and Type | Method and Description |
|---|---|
T |
peek() |
T |
pop()
Removes and returns the element on the top of the stack.
|
void |
push(T value)
Pushes a value on the top of the stack.
|
void push(T value)
T pop()
java.util.NoSuchElementException - The stack is emptyT peek()
java.util.NoSuchElementException - The stack is empty