0

the devs really have to change the wording in this section

"if you try to get a value that is not present your map, it returns the value of null" this was really confusing the first 7 times I tried to read it but I caught on eventually. ......

14th Oct 2016, 2:21 AM
WHITEHOOD
1 Resposta
0
But it is exactly accurate. If you have a map: Map<String, String> map = new HashMap<>(); map.put("key", "value"); map.put("otherKey", "otherValue"); System.out.println(map.get("key")); // prints "value" System.out.println(map.get("otherKey")); // prints "otherValue" System.out.println(map.get("a value not in the map")); // prints null
16th Mar 2017, 6:17 PM
Kevin