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. ......
1 Odpowiedź
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