0

I have 2 Maps like below

    LinkedHashMap<String,String> m1 = new LinkedHashMap<String,String>();
    Map<String,String> m2 = new HashMap<String,String>();

I need to get values from both of the maps but for m2 I have to get range(sets) of values with a range between 1st and 2nd... 2nd and 3rd key of m1(m1 keys available in m2). How can I achieve that?

for(Map.Entry<String,String> m: m1.entrySet()){
    String curKey = m.getKey();
    String curVal = m.getValue();
    //Write values in file
    //get values with the range between start=curKey and end=nextKey from m2 map
    //Write m2 map values in file
}
Saravanan
  • 67
  • 2
  • 11

0 Answers0