title: Iterate Java Map with index
body: <p>How can I iterate a Map to write the content from certain index to another.</p>
  
  <pre><code>Map&lt;String, Integer&gt; map = new LinkedHashMap&lt;&gt;();
      BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));
  
              for (String string : map.keySet()) {
  
                      bufferedWriter.write(string + " " + map.get(string));
                      bufferedWriter.newLine();
  
              }
              bufferedWriter.close();
  </code></pre>
  
  <p>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?</p>