Why does Treeset<Object> contains() return false even if Object.equals() and Object.compareTo() are consistent?

前端 未结 0 349
执念已碎
执念已碎 2021-02-02 03:12

I use a TreeSet to sort the Task objects in the game engine that I\'m developing. I wrote the compareTo() method in Task, the compar

相关标签:
回答
  • 消灭零回复
提交回复
热议问题