I want to print a nested HashMap which is :
HashMap<Integer,HashMap<Character,Integer>> map;
I searched a lot but I can't find a way to print the Integer because when I use getValues() on it, it tells me : "cannot find symbol". (Because it's an Integer value)
This is what I tried to do :
public void print(){
for(Map.Entry<Integer, HashMap<Character,Integer>> t :this.map.entrySet()){
Integer key = t.getKey();
for (Map.Entry<Character,Integer> e : this.map.getValue().entrySet())
System.out.println("OuterKey:" + key + " InnerKey: " + e.getKey()+ " VALUE:" +e.getValue());
}
}
I can't use getValue() in my second for, so what else can I use ?
Thanks in advance ! Have a nice day. Chris.