public interface Stack<E>
Modifier and Type | Method and Description |
---|---|
boolean |
isEmpty()
Reports whether the stack is currently empty without changing it.
|
E |
peek()
Reports the top element of the stack without changing it.
|
E |
pop()
Removes an element from the top of the stack and reports it.
|
void |
push(E x)
Pushes a new entry onto the stack.
|
void push(E x)
x
- the object to be pushed onto the stack
E peek()
java.util.NoSuchElementException
- if the stack is empty
E pop()
java.util.NoSuchElementException
- if the stack is already empty
boolean isEmpty()