public class Stack { private java.util.Vector pool = new java.util.Vector(); public Stack() { } public Stack(int n) { pool.ensureCapacity(n); } public void clear() { pool.clear(); } public boolean isEmpty() { return pool.isEmpty(); } public Object topEl() { return pool.lastElement(); } public Object pop() { return pool.remove(pool.size()-1); } public void push(Object el) { pool.addElement(el); } public String toString() { return pool.toString(); } }