list返回的是有顺序的,而set返回来的是无顺序的
for(Iterator iter = set.iterator();iter.hasNext();){
Person p = (Person)iter.next();
System.out.println(p);
}
for(Iterator iter = list.iterator();iter.hasNext();){
System.out.println(iter.next());
}
list返回的是有顺序的,而set返回来的是无顺序的
for(Iterator iter = set.iterator();iter.hasNext();){
Person p = (Person)iter.next();
System.out.println(p);
}
for(Iterator iter = list.iterator();iter.hasNext();){
System.out.println(iter.next());
}