定义的接口public interface StackInterface { void push(Object value); Object pop(); boolean isEmpty();}实现类:public class StackImplement implements StackInterface{ private Vector vector; public StackImplement(){ this.vector = new Vector(); } @Override public boolean isEmpty() { return vector.isEmpty(); } @Override public Object pop() { Object obj; int len = vector.size(); if(len==0){ throw new EmptyStackException(); } obj = vector.elementAt(len-1); vector.removeElementAt(len - 1); return obj; } @Override public void push(Object value) { vector.addElement(value); }}Stack的底层就是类似实现的!望参考!