求助: Map> Student怎么取值

jueyh 2012-12-12 01:10:49
求助: Map<string, ArrayList<Student>> = new HashMap<string, ArrayList<Student>>();
ArrayList<Student>中的属性遍历怎么取值
...全文
184 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
suciver 2012-12-12
  • 打赏
  • 举报
回复

Map<string, ArrayList<Student>> map= new HashMap<string, ArrayList<Student>>();
for(Map.Entry<String,ArrayList<Student>> entry:map.entrySet()){
   ArrayList<Student> list=entry.getValue();
   for(Student student:list){
      System.out.println(student.getName());
      .......
   }
}

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧