正在加载图片...
Class Declaration Class Body public class Stack Variable private Vector items; public Stack(){ Constructor items new Vector(10); public Object push(object item){ items.addElement(item); return item; public synchronized Object pop(){ int len items.size(); Object obj null; if (1en ==0) Methods throw new EmptyStackException(); obj items.elementAt(1en -1) items.removeElementAt(1en -1); return obj; public boolean isEmpty(){ if (items.size()=0) return true; else return false; protected void finalize()throws Throwable items nulli Cleanup super.finalize();5-5 Programming in Java 类的组成
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有