When I overide equals(), NetBeans offered to generate hashCode(). I
oblidge, so the generated hashCode() is as below:
public int hashCode(){
int hash = 7;
// Why this monstrosity?
hash = 89 * hash + (this.name != null ? this.name.hashCode() : 0);
// Isn't this simpler? Use <String>'s hashCode().
hash = this.name != null ? this.name.hashCode() : 0
return hash;
}
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---