Skip to content

Commit f5f3a14

Browse files
authored
Update HashCode&EqualsContract.md
1 parent ae28d87 commit f5f3a14

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/com/deepak/data/structures/Hashing/HashCode&EqualsContract.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ This time it will be unique elements printed.
104104
Complete implementation of this program is [here](../Hashing/HashCodeAndEquals.java)
105105

106106
#### Important things to remember
107-
* Always use same attributes of an object to generate hashCode() and equals() both.
108-
* Whenever a.equals(b), then a.hashCode() must be same as b.hashCode().
109-
* If you override one, then you should override the other.
110-
* In case of ORM ensure you use getters and not field references.
107+
```
108+
- Always use same attributes of an object to generate hashCode() and equals() both.
109+
- Whenever a.equals(b), then a.hashCode() must be same as b.hashCode().
110+
- If you override one, then you should override the other.
111+
- In case of ORM ensure you use getters and not field references.
112+
```
111113

112114
Here is a nice article about it,
113-
[HashCode and Equals](http://www.javaranch.com/journal/2002/10/equalhash.html)
115+
[HashCode and Equals](http://www.javaranch.com/journal/2002/10/equalhash.html)

0 commit comments

Comments
 (0)