title: Problem counting in Map<String, Integer>
body: <p>I asked a <a href="https://stackoverflow.com/questions/2194215/problem-in-count-field-in-arraylist-and-save-it">question</a> about counting the number of times a word is in ArrayList:</p>
  
  <pre><code>ACU ACU ACU ACU ACY ACY AER AER AER AGC
  </code></pre>
  
  <p>So for<br>
  ACU we will get 4,<br>
  ACY we will get 2,<br>
  AER we will get 3,<br>
  AGC we will get 1.  </p>
  
  <p>I got some help but I cannot make it work.<br>
  Darren gave me a very important answer:</p>
  
  <pre><code>Map&lt;String, Integer&gt;wordCount = new HashMap&lt;String, int&gt;();
    for(String seq : yourWordList){
       wordCount.put(seq, wordCount.get(seq++));
    }
  </code></pre>
  
  <p>But in the part <code>wordCount.put(seq, wordCount.get(seq++));</code>
  I get an error that cannot convert from String to int, I tried to modify the code to work
  but I'm getting incorrect numbers</p>
  
  <p>ACU  0
  ACU  1
  ACU  1
  ACU  1
  ACY  1
  ACY  2
  AER  2
  AER  3
  AER  3</p>
  
  <pre><code>int value=0;
  Map&lt;String, Integer&gt;wordCount = new HashMap&lt;String, Integer&gt;();
  for(String seq : WordList){
    Set&lt;String&gt; set = wordCount.keySet();
    value = set.size();
    wordCount.put(seq, value));
  }
  </code></pre>
  
  <p>Please help me on this one. Thanks to all.</p>