HashSet add() 方法底层调用HashMap时,存入的value为什么不是null?
看jdk源码,看到 LinkedHashSet时,说底层调用的LinkedHashMap进行存放数据,点入LinkedHashSet的add方法看了一下,看到如下代码:
/**
* Adds the specified element to this set if it is not already present.
* More formally, adds the specified element <tt>e</tt> to this set i
原创
2020-07-02 18:10:32 ·
603 阅读 ·
0 评论