equals步骤在HashSet与TreeSet中的行为差异

equals方法在HashSet与TreeSet中的行为差异我们知道equals方法在HashSet中起到了contains中判断是否为同一

equals方法在HashSet与TreeSet中的行为差异
我们知道equals方法在HashSet中起到了contains中判断是否为同一对象的作用。

items.contains(item)


如果items是 HashSet 是 true
如果是TreeSet 那就是false。

但在TreeSet中的行为会有一些差异。这点要注意。

西兴农厨饭店冬瓜味道不错!