vipcolud / vipcolud.github.io

个人博客
https://vipcolud.github.io/
1 stars 0 forks source link

so far away #9

Open vipcolud opened 6 years ago

vipcolud commented 6 years ago

https://www.belongapp.fun/2018/10/18/so%20far%20away/

专注于后端开发,

vipcolud commented 6 years ago

Wong Kar Wai once asked his actors to translate I love you, some actors translate into I love you. And the king said, How can you say such a thing? It must be I havent been on a motorcycle in a long time, and havent been this close to a person for a long time, although I know its not that far. I know Ill get off soon. But this one minute, I feel so warm.

vipcolud commented 5 years ago

hashCode()与equals()的相关规定

  1. 如果两个对象相等,则hashcode一定也是相同的
  2. 两个对象相等,对两个对象分别调用equals方法都返回true
  3. 两个对象有相同的hashcode值,它们也不一定是相等的
  4. 因此,equals 方法被覆盖过,则 hashCode 方法也必须被覆盖
  5. hashCode() 的默认行为是对堆上的对象产生独特值。如果没有重写 hashCode(),则该 class 的两个对象无论如何都不会相等(即使这两个对象指向相同的数据)