Prepare for your Next Interview
This is a discussion on Java related within the Java forums, part of the Software Development category; Why do you need to override Hashcode? what happens if you don't?...
|
|||
|
Re: Java related
Hi
If two objects are equal, their hash code must also be equal. If you override the equals() method, you change the way two objects are equated and Object's implementation of hashCode() is no longer valid. Therefore, if you override the equals() method, you must also override the hashCode() method as well. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inter-Related Parameters | ARB55 | LoadRunner | 1 | 05-02-2007 06:04 AM |
| A typical problem related to SQL | anand.kr.singh | SQL | 0 | 03-30-2007 03:34 PM |
| Questions related to Test plan | whizen | Testing Issues | 4 | 03-13-2007 02:52 PM |
| AudioGrail is the swiss army knife for everthing that is related to audio files. | JobHelper | Geeks Lounge | 0 | 01-22-2007 12:20 PM |