Hi
I have a class which has three instance variables
say
boolean isAllowed
boolean isValid
String[] names
i have implemented the equals method by comparing all the three for the equality option
Now i have to implement the hashCode() for the class
String[] names - will always have atleast one name that is this array will have atleast one element in it.
so is it a reasonable choice to return the hashCode as names[0].hashCode()
or is there a better way to implement the hashCode() in the current case.
Any idea would be great.
Regards,
Vijay V