title: Java FileReader put ((char) i), k++) in HashMap
body: <p>I am trying to read the contents of a file and count how often each letter appears. This is my situation:</p>
  
  <pre><code>public static void readFile() throws Exception {
  
      Map&lt;Character, Integer&gt; lcount = new HashMap&lt;&gt;();
  
      for (Character letter = 'A'; letter &lt;= 'Z'; letter++) {
          lcount.put(letter, 0);
      }
  
      try {
          FileReader reader = new FileReader("file.txt");
          for (int i = 1; i != -1; i = reader.read()) {
              int k = lcount.get((char) i);
              lcount.put((char) i) ,k++);
          }
      } catch (FileNotFoundException e) {
          System.out.println("The file does not exist.");
      }
  }
  </code></pre>
  
  <p>I cannot use ((char) i, k++) to increase the letter count in my HashMap.</p>
  
  <p>The exception says: <strong>put (Character, Integer) in Map cannot be applied to (char)</strong></p>
  
  <p>How can I read the value of type Character at location i and use it as a key to put a value to it in my HashMap?</p>
  
  <p>Thanks in advance.</p>
  
  <blockquote>
    <p>EDIT: Thanks to @Ferrybig. I just missed a "(". I thought it was about
    the variable type.</p>
  </blockquote>