why HashMap contains single null value in java ?
I have asked in an Interview why HashMap allows Null Value. I found an article it describing the implementation of HashMap. but doesn't show why it only contains null. what is reason behind that, why Designer design to contains Null. From Oracle Source...
public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable
Hash table based implementation of the Map interface. This implementation provides all of the optional map operations, and permits null values and the null key. (The HashMap class is roughly equivalent to Hashtable
http://docs.oracle.com/javase/6/docs/api/java/util/HashMap.html
but why HashMap allows only single Null value ?