On Java Development

All things related to Java development, from the perspective of a caveman.

Archive for the ‘Java Lists and Maps’ tag

Iterating through a Hashmap

without comments


Unlike Lists, and ArrayLists should come to mind, Maps don’t have an iterator() method like that provided by the Set or List classes. However, you can iterate through the keys or the key-value elements.

There are a few different types of maps such as HashMap, TreeMap and LinkedHashMap. The ordering of the elements in each differ a bit depending on the type of map.
Read the rest of this entry »

Written by admin

March 28th, 2014 at 6:24 am