@@ -83,31 +83,7 @@ <h5>enum Animal</h5>
83
83
< span class ="returntype "> int</ span >
84
84
< span class ="name "> hashCode</ span > </ section >
85
85
86
- < section class ="desc markdown ">
87
- < p > The hash code for this object.</ p >
88
- < p > A hash code is a single integer which represents the state of the object
89
- that affects < code > ==</ code > comparisons.</ p >
90
- < p > All objects have hash codes.
91
- The default hash code represents only the identity of the object,
92
- the same way as the default < code > ==</ code > implementation only considers objects
93
- equal if they are identical (see < code > identityHashCode</ code > ).</ p >
94
- < p > If < code > ==</ code > is overridden to use the object state instead,
95
- the hash code must also be changed to represent that state.</ p >
96
- < p > Hash codes must be the same for objects that are equal to each other
97
- according to < code > ==</ code > .
98
- The hash code of an object should only change if the object changes
99
- in a way that affects equality.
100
- There are no further requirements for the hash codes.
101
- They need not be consistent between executions of the same program
102
- and there are no distribution guarantees.</ p >
103
- < p > Objects that are not equal are allowed to have the same hash code,
104
- it is even technically allowed that all instances have the same hash code,
105
- but if clashes happen too often, it may reduce the efficiency of hash-based
106
- data structures like < code > HashSet</ code > or < code > HashMap</ code > .</ p >
107
- < p > If a subclass overrides < code > hashCode</ code > , it should override the
108
- < code > ==</ code > operator as well to maintain consistency.</ p >
109
- </ section >
110
- </ section >
86
+ </ section >
111
87
112
88
113
89
0 commit comments