Why do we need to override Hascode and Equals method?
843789Nov 24 2009 — edited Jan 7 2010Hi,
== checks if the two references are equal and .equlas will check if the value is same, if we want .equals to take care of both reference and value are correct. why cant I just override equals with an extra check that references are equal(==).
Please someone elaborate on this and also tell me what role hashcode plays in this.
thanks
Anirudh