I am getting an error message.
Suspicious call to java.util.Map.ContainsValue Given object cannot contain instance of String (Except ArrayList)
This is a small version of the program that I am working with. Could someone suggest how to fix this? Please post code. I am not a strong programer.
import java.util.ArrayList;
import java.util.HashMap;
public class Main {
public static void main(String[] a) {
HashMap<String,ArrayList> map = new HashMap<String,ArrayList>();
//hashMap.put(key, new ArrayList());
map.put("key1", new ArrayList());
map.get("key1").add("value2");
//System.out.println(map.containsKey("key1"));
System.out.println(map.containsValue("value2"));
}
}