Hi, I wanted to store key and value of a nested Map that looks like this:
Map<ArrayList <String>, Map<String, Integer>> NestedMap = new HashMap<ArrayList<String>, Map<String, Integer>();
into another variable let say getKeyFromInsideMap and getValueFromInsideMap. So it would be the values of the inside Map String and Integer that am interested in accessing. How do I this in a code?
I tried several examples here in the forum but I don’t know how the syntax would look like. Could you please provide some code for this. Thank you!
You get the values from the nested by Map the same way as you get them from an unnested Map, you just have to apply the same process twice:
Also if you are looking for a specific key, you can iterate over the map like so:
this will iterate over all of the keys and value of a single map.
Hope this helps.