Answers for "how to print a Map<> in java"

4

print map java

map.forEach((key, value) -> System.out.println(key + ":" + value));
Posted by: Guest on June-11-2020
0

print map in java

Map<String, Integer> map = new HashMap<>();
map.put("a", 1);
map.put("b", 2);
System.out.println(Arrays.asList(map)); // method 1
System.out.println(Collections.singletonList(map)); // method 2
Posted by: Guest on October-20-2020

Code answers related to "how to print a Map<> in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language