Hashtable、ConcurrentHashTable,TreeMap不允许key为null,编译运行时会提示空指针异常。
HashSet 、HashMap 、 ArrayList 、 LinkedList均可接受null值
public static void main(String[] args) {
/* TreeMap<Object, Object> map = new TreeMap<>();
map.put(null, 1);*/
/* TreeSet<Object> objects = new TreeSet<>();
objects.add(null);*/
/* ConcurrentHashMap<Object, Object> a = new ConcurrentHashMap<>();
a.put(null, 1);*/
HashSet<Object> objects1 = new HashSet