一个泛型栈类(GenericStack)
摘要:
public class GenericStack<E> { private java.util.ArrayList<E> list = new java.util.ArrayList<E> (); public int getSize() { return list.size(); } // get peek of the stack public E peek() { return list.get(getSize() - 1); } // push an E element into stack public void push(E o) { list 阅读全文
posted @ 2013-02-28 16:43 Jam_01 阅读(732) 评论(0) 推荐(0)
浙公网安备 33010602011771号