不懂,求大神教教,是遍历,然后再取类中的key和value吗

public void browselist(Map<String, HomeworkList> map){


    Set<Map.Entry<String, HomeworkList>> set = map.entrySet();
    for(Iterator<Map.Entry<String, HomeworkList>> it = set.iterator();
            it.hasNext();){

        Map.Entry<String, HomeworkList> entry = (Map.Entry<String, HomeworkList>)it.next();

        System.out.println(entry.getKey()+"-"+entry.getValue());
    }

}
查看全部
qq_22538403
qq_22538403
2015/09/06 08:24
  • java
  • map
  • 点赞
  • 收藏
  • 回答
    私信

4个回复