java - The type HashMap is not generic; it cannot be parameterized with arguments <String, Integer> -


this strange error getting today when try implement map below.

map<string, integer> cache = new hashmap<string, integer>(); 

i using jdk 1.7 , not sure why error has been coming , changing above line adding cast removes error. i looked @ related posts in stackoverflow before posting question seems strange issue.

map<string, integer> cache = (map<string, integer>) new hashmap(); 

check using java.util.hashmap , java.util.map in imports.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -