Java集合(12)--TreeSet源码分析

TreeSet 底层实际使用的存储容器就是 TreeMap,他们的关系就像HashMap和HashSet的关系。

TreeSet采用了TreeMap作为其Map保存“键-值”对,所以TreeSet判断元素重复是依靠Comparable接口或Comparator接口实现的。

原文地址:https://www.cnblogs.com/pipi-style/p/4738052.html