Hi all, I was wondering which is the best way of iterating through a hashmap. I cannot use iterator as it isn't define for HashMap. Should I cast the hashMap to some other data structure and iterate through that.
Take a look at Section 12.3 of David J. Eck's Introduction to Programming Using Java. About a third of the way down the page is the "Views, SubSets, and SubMaps" section that discusses iterating through all of the associations in a Map.