...
Thus, the hashcode of an object need not remain consistent across different executions of the application. Similarly, if an object is serialized, its hashcode may not stay consistent with the original value. This introduces several hurdles; for oneexample, upon deserialization it would be is impossible to retrieve the object since because its corresponding key could have changed.
...
This example follows the above advice but serialization is still at the mercy of the implementation of the hashcode
method. It is not required to produce a key value (hashcode) that is consistent across different executions of the program or during (de)serialization. ThusTherefore, using the default serialized form of the hashtable may be inappropriate. In this example, it is not possible to retrieve the value of the object using the original key after deserialization.
...