title: The type HashMap is not generic; it cannot be parameterized with arguments <String, Integer>
body: <p>This is a strange error i am getting today when i try to implement a Map as below. </p>
  
  <pre><code>Map&lt;String, Integer&gt; cache = new HashMap&lt;String, Integer&gt;();
  </code></pre>
  
  <p>I am using <strong>JDK 1.7</strong> and not sure why this error has been coming and changing the above line by adding cast removes the error. <strong>I looked at the related posts in stackoverflow before posting this question seems to be strange issue.</strong></p>
  
  <pre><code>Map&lt;String, Integer&gt; cache = (Map&lt;String, Integer&gt;) new HashMap();
  </code></pre>