HashMap<String, Integer> map = new HashMap<>();
map.put("김자바", 90);
map.put("김자바", 100);
map.put("이자바", 100);
map.put("강자바", 80);
map.put("안자바", 90);
Set set = map.entrySet();
Iterator it = set.iterator();
while(it.hasNext()) {
// Iterator 조상타입 -> Map.Entry 자손 타입의 형변환 ( 다운 캐스팅 )
Map.Entry e = (Map.Entry)it.next();
System.out.println("이름 : "+ e.getKey() + ", 점수 : " + e.getValue());
}
참조:
Map<String, Map<String, Object>> map = CodeService.selectApplyFile(applyFileType, tbId);
System.out.println(".jsp =====================================================");
Set set = map.entrySet();
Iterator it = set.iterator();
while(it.hasNext()) {
// Iterator 조상타입 -> Map.Entry 자손 타입의 형변환 ( 다운 캐스팅 )
Map.Entry e = (Map.Entry)it.next();
System.out.println("key : "+ e.getKey() + ", value : " + e.getValue());
}
System.out.println(".jsp =====================================================");