0001 /* 0002 * 栈接口 0003 */ 0004 0005 package dsa; 0006 0007 public interface Stack { 0008 public int getSize();//返回栈中元素数目 0009 public boolean isEmpty();//判断栈是否为空 0010 public Object top() throws ExceptionStackEmpty;//取栈顶元素(但不删除) 0011 public void push (Object ele);//入栈 0012 public Object pop() throws ExceptionStackEmpty;//出栈 0013 }