How can I iterate a Map to write the content from certain index to another.
Map<String, Integer> map = new LinkedHashMap<>();
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));
for (String string : map.keySet()) {
bufferedWriter.write(string + " " + map.get(string));
bufferedWriter.newLine();
}
bufferedWriter.close();
I have two int values, from and to, how can I now write for example from 10 to 100? is there any possibility to iterate the map with index?