How does the JVM ensure that System.identityHashCode() will never change?

前端 未结 5 929
终归单人心
终归单人心 2020-11-29 00:33

Typically the default implementation of Object.hashCode() is some function of the allocated address of the object in memory (though this is not

5条回答
  •  無奈伤痛
    2020-11-29 00:51

    As far as I know, this is implemented to return the reference, that will never change in a objects lifetime .

提交回复
热议问题