Check out example codes for "how to iterate hashmap java". It will help you in understanding the concepts better.

Code Example 1

Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
    System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
}

Code Example 2

for (Map.Entry<String, String> entry : yourHashMap.entrySet()) {
	System.out.println(entry.getKey() + " = " + entry.getValue());
}

Learn ReactJs, React Native from akashmittal.com