Object.hashCode() algorithm

前端 未结 4 1180
醉梦人生
醉梦人生 2020-12-17 15:45

I\'m looking for the algorithm of Object.hashCode().

This code is native in Object.java.

Is this because

(a) the code is in assemb

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 16:27

    Native hashCode method implementation depends on the JVM. By default in HotSpot it returns random number, you can check it in the source code (function get_next_hash)

提交回复
热议问题