java iterate through hashmap
for (Map.Entry<String, String> entry : yourHashMap.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
java iterate through hashmap
for (Map.Entry<String, String> entry : yourHashMap.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
map interation in java
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
// Iterating over keys only
for (Integer key : map.keySet()) {
System.out.println("Key = " + key);
}
// Iterating over values only
for (Integer value : map.values()) {
System.out.println("Value = " + value);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us