get keys from hashmap java code example
Example 1: java hashmap get array of keys
for (int key : myHashMap.keySet()){
// do stuff
}
Example 2: java get keys from hashmap
//returns as set
hashmap.keySet()
for (int key : myHashMap.keySet()){
// do stuff
}
//returns as set
hashmap.keySet()