I have the following code:
/*
if inputDetailsMap has values like:
String String
key1 value1
key2 value2
key3 value3
key4 value4
key5 value5
so on.....
*/
public void inputData(Map<String,String> inputDetailsMap, String fileName){
//a for loop to run
String value = inputDetailsMap.get("key" + i); // i value comes from the for loop
//i am doing something with the value.
//end of for loop
}
The above code works well if i want to iterate through Map. But now i have something like this.
/*
inputDetailsMap has values like:
int String String
1 key1 value1
key2 value2
key3 value3
key4 value4
key5 value5
2 key1 value1
key2 value2
key3 value3
key4 value4
key5 value5
so on.....
*/
public void inputData(Map<Integer,Map<String,String>> inputDetailsMap, String fileName){
//how to iterate and get the value using inputDetailsMap.get() like the above code??
}
I want to iterate through the Map within the Map and get the key and values for it. I want to get the value of key1,value1,key2,value2,key3,value3, and so on. So how should i go about it?