mirror of
https://github.com/corda/corda.git
synced 2025-01-01 10:46:46 +00:00
21 lines
299 B
Java
21 lines
299 B
Java
package java.util;
|
|
|
|
public class Stack<T> extends Vector<T> {
|
|
public boolean empty() {
|
|
return size() != 0;
|
|
}
|
|
|
|
public T peek() {
|
|
return get(size() - 1);
|
|
}
|
|
|
|
public T pop() {
|
|
return remove(size() - 1);
|
|
}
|
|
|
|
public T push(T element) {
|
|
add(element);
|
|
return element;
|
|
}
|
|
}
|