JAVA
beecindy
hi
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HashSet与TreeSet
HashSetpublic class HashSetTest {public static void main(String []args){HashSet hs=new HashSet();/* hs.add("one");hs.add("two");hs.add("three");hs.add("one");*/hs.add(new Student(1原创 2010-03-26 18:22:00 · 532 阅读 · 0 评论 -
HashMap
hashmapimport java.util.*;public class HashMapTest{public static void printElements(Collection c){Iterator it=c.iterator();while(it.hasNext()){System.out.println(it.next());}}p原创 2010-03-26 18:22:00 · 371 阅读 · 0 评论 -
Vector
vectorimport java.util.*;class MyCompare implements Comparator // 实现Comparator,定义自己的比较方法{public int compare(Object o1, Object o2) {Elem e1 = (Elem) o1;Elem e2 = (Elem) o2;if (e1.get() >原创 2010-03-26 18:21:00 · 346 阅读 · 0 评论
分享