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());
}

참조:

https://hstory0208.tistory.com/entry/Java%EC%9E%90%EB%B0%94-HashMap-%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%82%AC%EC%9A%A9%EB%B2%95

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 =====================================================");

 

 

 

 

Posted by useways
,