集合
集合:Vector 和Enumeration 一對
如
Vector v = new Vector();
Enumeration e = v.elements();
e.nextElement 指示器正指向的元素對象
e.hasMoreElements 回是否還有元素
List 和Iterator 一對
如
ArrayList al = new ArrayList();
Iterator it = al.iterator();
it.next();
it.hasNext();
附加一句:排序使用Collections 的一個靜態方法:Collections.sort(集合對象);
posted on 2005-12-30 03:33 大森林 閱讀(187) 評論(0) 編輯 收藏 所屬分類: JAVA學習筆