Iterator it = myHashMap.keySet().iterator();
while (it.hasNext()) {
int next = it.next();
}
That doesn't work because it.next() returns Object. My hashmap uses ints for keys. All of my methods accept ints to access the hashmap. How can I actually get an int value when looping through my keys so I can pass it to my other methods?