Changing hashCode of object stored in hash-based collection

前端 未结 5 1142
孤独总比滥情好
孤独总比滥情好 2021-01-15 12:02

I have a hash-based collection of objects, such as HashSet or HashMap. What issues can I run into when the implementation of hashCode()

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 12:45

    The Javadoc spefically says that the built-in Collections don't support this. So don't do it.

提交回复
热议问题