Only the second one actually works, so there is no point in considering the first one. The documentation for the "get" method says:
"A return value of null does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to null. The containsKey method may be used to distinguish these two cases."
Joined: Sep 13, 2004
Thanks for point me to HashMap documentation.. I forgot that hash map allows null keys. But what if it is hash table..?