venkatesh goud wrote:. . . http://www.technofundo.com/tech/java/equalhash.html
That link has an error in; it uses == to compare Strings in a correct implementation (
sic). It is also out of date, using J2SE1.4. Otherwise it is a good article Neither link tells us to use the @Override annotation, which one should use for any overridden method in Java5 or Java6.
This question about equals and hashCode comes up frequently; do a search and you find several good links:
this post includes links to Odersky, Angelika Langer, and Bloch. Beware: the equals() method is by no means easy to override.