Language:Java; niveau:Intermédiaire
Object
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
the contract of the hashcode() defined in the Object class is as follows:
1.If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
2.It is not required that if two objects are unequal according to the equals(java.lang.Object)
method, then calling the hashCode
method on each of the two objects must produce distinct integer results.
3.Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer,