Question: can null be a key in hashmap?
Answer: Hence there can only be one null key in one hashmap object. If you pass null as map key, it will go to 0 bucket . All values of null key will go there. That is why it returns same value, cause all keys you are providing are null and are in the same bucket of your HashMap.