To iterate throug a map in Java you can use the snippet below.

for (Map.Entry<String, Object> entry : mp.entrySet()) {
	String key = entry.getKey();
	Object value = entry.getValue();
}

6 thought on “How to iterate throug a map in Java”

Leave a Reply