The JavaDoc of ConcurrentHashMap says this:
Like
Hashtable
but unlikeHashMap
, this class does not allownull
to be used as a key or value.
My question: why?
2nd question: why doesn't Hashtable allow null?
I've used a lot of HashMaps for storing data. But when changing to ConcurrentHashMap I got several times into trouble because of NullPointerExceptions.