Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有List一些 Objects 。我必须对列表中所有相等的对象进行分组。 在这里我不必重写euals()方法。(它已经被其他功能覆盖)
List
euals()
请帮我。
除非您想从 Object 类中获得默认的 equals 行为,否则如果不覆盖 equals() 方法,就无法判断对象是否相等。当您说对象相等时,它们也应该具有相同的哈希码。