adam bien's blog

Java 8: Dumping Content Of a Map 📎


Map<String, String> map = new HashMap<>();
	map.put("java", "42");
	map.forEach((key, value)
			-> System.out.printf("Key: %s Value: %s", key, value)
	);
}

Output: Key: java Value: 42