@duyao
2015-05-20T02:26:38.000000Z
字数 505
阅读 1083
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遍历,知道类型,取出,找到对应的arraylistfor (Student student : arrayList) {System.out.println(student.getStuid());}}