摘要: equals()和hascode()区别?(字节1) 两个方法都能用来对比两个对象是否相等。区别在于:性能和可靠性; (1)性能上: equals对比的效率会比较低。 (2)可靠性上: 1. equals()对比是绝对可靠的,equals()相等的两个对象他们的hashCode()肯定相等。 2. 阅读全文
posted @ 2022-08-03 09:40 JustJavaIt 阅读(38) 评论(0) 推荐(0)
摘要: hashCode() 1 /** 2 * Returns a hash code value for the object. This method is 3 * supported for the benefit of hash tables such as those provided by 4 阅读全文
posted @ 2022-08-03 09:19 JustJavaIt 阅读(87) 评论(0) 推荐(0)