Java HashMap with Int Array
- by Sunil
Hello
I am using this code to check that array is present in the HashMap.
public class Test {
public static void main(String[]arg)
{
HashMap<int[],String> map= new HashMap<int[],String>();
map.put(new int[]{1,2}, "sun");
System.out.println(map.containsKey((new int[]{1,2})));
}
}
But this prints False.
How can I check that array is present in the HashMap.
Thanks in advance.