T
- The element typepublic interface Stack<T> extends 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.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
void push(T value)
T pop()
NoSuchElementException
- The stack is emptyT peek()
NoSuchElementException
- The stack is emptyCopyright © 2018 Arno Unkrig. All rights reserved.