Don't forget to also checkout my second blog containing articles to all other related ICT topics!!

Friday, May 25, 2012

3 golden rules for implementing equality

  • If two objects are equal, they should have the same hashCode. 
  • A hashCode computed for an object won’t change for the life of the object. 
  • When sending an object to another JVM, equality should be determined using attributes available in both JVMs.

No comments:

Post a Comment