Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java hashmap get nonexistent key

// it returns null
HashMap<Integer,Integer> m = new HashMap<>();
m.put(5, 3);
m.get(5); // returns 3
m.get(4); // returns null
 
PREVIOUS NEXT
Tagged: #java #hashmap #nonexistent #key
ADD COMMENT
Topic
Name
8+7 =