正在加载图片...
a2水 美的组戒 5-5 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(len -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 null; Cleanup super.finalize(); Programming in Java JAVA5-5 Programming in Java 类的组成
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有