It would help if you print out more details -- such as "name" or other parts of the instance, in addition to the hash code. We don't know anything about the instances that you are referring to.
And BTW, it is valid for two unequal instances to have the same hash code -- so there may be nothing wrong.
It would help if you print out more details -- such as "name" or other parts of the instance, in addition to the hash code. We don't know anything about the instances that you are referring to.
And BTW, it is valid for two unequal instances to have the same hash code -- so there may be nothing wrong.
Henry
I think I resolved it now:
Output 847 for _name = "Johnny"
847 for _name = "Johnny"
729 for "_name = "Peter"
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
4
posted
1
Why do you start your variable names with underscores?