Well i don't know how you missed it
If you are clear on what put(key, value) takes as an argument and
what get(key) takes as an argument then I bet you'll be 100% clear.
Let me try and explain:
m.put(d1,"DOG");
| |
| |
\/ \/
key value
m.get(d1));
//this returns DOG because it searched for the value put against the key d1
//which you did put in earlier.
m.get("DOG");
//this returns null because it searched for the value put against the key
//"DOG" which you never put in earlier.
