public interface StackInterface<T>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all entries from this stack.
|
boolean |
isEmpty()
Detects whether this stack is empty.
|
T |
peek()
Retrieves this stack's top entry.
|
T |
pop()
Removes and returns this stack's top entry.
|
void |
push(T newEntry)
Adds a new entry to the top of this stack.
|
void push(T newEntry)
newEntry
- An object to be added to the stack.T pop()
EmptyStackException
- if the stack is empty before the operation.T peek()
EmptyStackException
- if the stack is empty.boolean isEmpty()
void clear()