I have a very simple class with only one field member (e.g. String). Is it OK to implement hashCode() to simply return fieldMember.hashCode()? Or should I manipulate the field’s hash code somehow? Also, if I should manipulate it, why is that?
I have a very simple class with only one field member (e.g. String). Is
Share
If fieldMember is a pretty good way to uniquely identify the object, I would say yes.