lundi 9 mars 2015

Java Iterate through a HashMap and for each Key count how many Values the Key has



I having problems on how to tackle this since I know a map has no specific order. I would think that you would iterate over the map's Keys and then check the value count by getting the size of the LinkedList since the Values to the Key are held in a LinkedList I can just call a size or length call for the LinkedList, but my main question is how to get inside the HashMap with an iterator first to do this?




Aucun commentaire:

Enregistrer un commentaire