Sneha Kapoor wrote:Hi All,
I had encountered one line in k&b book which says that hashmap can have one null key and multiple null value.can any one giveme e.g. of the same.Also how do we fetch if value is null or key is null
Thanks all
As far as I understand, HashMap can have one null key means that you can it can hold one unique value against a key which is null.
It can have multiple null values because, retrieval from map only depends on the key and not on the values.