How to Iterate HashMap of type HashMap<String, ArrayList<String>>
Anu satya
Ranch Hand
Joined: Mar 17, 2005
Posts: 146
posted
0
HI,
I am trying to iterate the hash Map. But, I am getting error at "for loop" please help.
I want the each value in the arraylist and do some string manipulation.
First of all, declare your map like this (line 14):
Then you can get rid of the casts in lines 18 and 22.
I tried your code and it worked without errors!
You most likely have a class that you wrote yourself that is called Map, and Java is getting confused, it takes your own class Map instead of the Map from java.util. Rename or delete your own class Map.