public interface Stack<E> extends Collection<E>
| 限定符和类型 | 方法和说明 |
|---|---|
E |
peek()
Looks at the object at the top of this stack without removing it
from the stack.
|
E |
pop()
Removes the object at the top of this stack and returns that
object as the value of this function.
|
E |
push(E item)
Pushes an item onto the top of this stack.
|
int |
search(Object o)
Returns the 1-based position where an object is on this stack.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArrayE push(E item)
addElement(item)
item - the item to be pushed onto this stack.item argument.Vector.addElement(E)E pop()
EmptyStackException - if this stack is empty.E peek()
EmptyStackException - if this stack is empty.int search(Object o)
o - the desired object.-1
indicates that the object is not on the stack.Copyright © 2021. All rights reserved.