Collection & null 

Can a Hashtable have a “null” key? Can a TreeSet hold a null? Confused?
Check the following table to know whether different data structures support null or not.

Collection       Key      Value
HashMap          Yes      Yes
HashTable        No       No
TreeMap          No       Yes

LinkedList       -        Yes
ArrayList        -        Yes
Vector           -        Yes

HashSet          -        Yes
TreeSet          -        No


Note:

TreeMap & TreeSet are sorted data structures. Thats why they don’t support null in their sort field.