UNB/ CS/ David Bremner/ teaching/ java/ VecStack.java
import java.util.*;
public class VecStack {
    private Vector stack = new Vector();
    public void push(Object item) {
        stack. addElement(item);
    }
    public Object pop() {
        Object item = top(); // retrieve item at top
        stack.removeElementAt(stack.size() - 1);
        return item;
    }
    public Object top() {
        if (isEmpty())
            throw new EmptyStackException();
        return stack.elementAt(stack.size() - 1);
    }
    public boolean isEmpty(){
        return (stack.size() == 0);
    }

    public int size(){
        return stack.size();
    }
    // VecStack
}
//