泛型(二)

2014-11-24 09:26:41 · 作者: · 浏览: 1
"邢台");

Set> set=hm.entrySet();
Iterator> it=set.iterator();
while(it.hasNext()){
Map.Entry me=it.next();
System.out.println(me.getKey().getName()+"..."+me.getValue());

}
}
@SuppressWarnings("unchecked")
publicstatic List getList(List list){
ListnewList=new ArrayList();
Iteratorit=list.iterator();
while(it.hasNext()){
Objectobj=it.next();
if(!(newList.contains(obj))){
newList.add(obj);
}
}
returnnewList;

}

}