title: How to add EOF in a map
body: <p>I'm reading this file:</p>
  
  <pre><code>ab ab cab
  </code></pre>
  
  <p>and counting the number of times each character appears and putting it in a map:</p>
  
  <pre><code>Map&lt;Character, Integer&gt; map = new TreeMap&lt;Character, Integer&gt;();
  </code></pre>
  
  <p>The resulting map looks like this:</p>
  
  <pre><code>{ =2, a=3, b=3, c=1 }
  </code></pre>
  
  <p>but I need the result to be this:</p>
  
  <pre><code>{ =2, a=3, b=3, c=1, EOF=1}
  </code></pre>
  
  <p>How do I add EOF=1 to the map? This is for an assignment and says I need that EOF=1.</p>