yoursyun

(Java) foreach Hashmap, ArrayList, Max value 본문

environment/java

(Java) foreach Hashmap, ArrayList, Max value

yoursyun 2022. 4. 6. 09:09

Hashmap

for (Map.Entry<String,String> date : l.entrySet()) {
   System.out.println("targetDate_date : " + date.getValue());
}

List

List<Map<String, Object>> targetDate
for (Map<String, Object> date : targetDate) {
   l.put(date.get("targetDate").toString(), date.get("targetDate").toString());
}
Collections.max(l.values())
반응형