I have made a hashmap
Map percentages= new HashMap();, I have entered values and keys into it and that was successful, but when I try to get the or try ContainsKey method then it returns false.
Please see the attached screen shot:
When assigning values to Map, you may used different datatype and when checking for key, you are using integer, it won’t work.
Map a = new HashMap(); a.put("1", 12); a.put("2", 32); System.out.println(a.containsKey(1));
This will always return false.