fun with collections

This commit is contained in:
Joel Dice
2007-07-21 21:47:29 -06:00
parent da17490206
commit ecd31a10a4
11 changed files with 566 additions and 0 deletions

View File

@ -0,0 +1,20 @@
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;
}
}