Why is it useful to have null values or null keys in hash maps?

Viewed 56970

Hashtable does not allow null keys or values, while HashMap allows null values and 1 null key.

Questions:

  1. Why is this so?
  2. How is it useful to have such a key and values in HashMap?
6 Answers
Related