package cn.itacst.p4.hashset.demo;
import java.util.HashSet;
import java.util.Iterator;
public class HashSetDemo {
public static void main(String[] args) {
HashSet hs = new HashSet();
hs.add("abc1");
hs.add("abc2");
hs.add("abc3");
hs.add("abc4");
Iterator it = hs.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
}
}
|
|