Mapのループ処理
Maploop.java
List<String> list = new ArrayList<String>(){
{
add("Apple");
add("Orange");
add("Melon");
}
};
map.put("ins1", list);
for(Entry<String, List<String>> entry:map.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue());
System.out.println(entry.getValue().get(0));
}
実行結果😚
ins1
[Apple, Orange, Melon]
Apple