@duyao
2015-05-20T02:26:38.000000Z
字数 505
阅读 1050
codeTool
TeamService tService=new TeamService();
//hashmap用entry遍历
HashMap<Integer, ArrayList<Student> > hasmap=tService.getAllTeam();
Iterator it = hasmap.entrySet().iterator();
while(it.hasNext()){
Entry entry=(Entry)it.next();
//先得到object,再转
Object key=entry.getKey();
int teamid=Integer.parseInt(key.toString());
Object value=entry.getValue();
ArrayList<Student> arrayList=(ArrayList<Student>)value;
//arraylist遍历,知道类型,取出,找到对应的arraylist
for (Student student : arrayList) {
System.out.println(student.getStuid());
}
}