import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
public class TestHashSet {
public static void main(String[] args) {
Random r = new Random();
HashSet hs1 = new HashSet();
for(int i=0; i<3000; i++){
hs1.add(r.nextInt(10));
}
Iterator it1 = hs1.iterator();
while(it1.hasNext()){
System.out.print(it1.next()+" ");
}
}
}
应该使用 popwindow做的 具体你可以查下相关资料