In accordance with the contract, the hashCode() method should return the same integer value ​​for two objects that are equal according to the equals() method. Is that true?
Explanation
Yes, if two objects are equal (equals() method returns true for them), the hashCode() method should return the same integer value for each of them. PS: According to the contract - "equal objects must have equal hash codes"

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести