Question: why null key is allowed in hashmap?
Answer: HashMap , allows storing one null key and multiple null values. The reason for allowing only one null key is because keys in a HashMap has to be unique. ... This is because the objects used as keys in a Hashtable implements the hashCode() and equals() methods for their storage and retrieval.