I'm writting an application that connects to some APIs, but when compiling, I get some warning messages:
warning: [unchecked] unchecked call to put(K, V) as a member of the raw type java.util.HashMap
Here is the code:
public class hashMapMgr {
HashMap hm;
public hashMapMgr() {
hm = new HashMap;
hm.clear();
}
public void addKey(String key, String value) throws myException {
Object status;
if (key.length()==0 && value.length()==0) {
throws new myException ("Error");
}
status = hm.put(key,value);
}
public HashMap getMap() {
return hm;
}
}
Why am I getting that warning message? Should I use a try..catch to remove the warning message? or should I extend or implement something?
Thanks