How is the == operator implemented in Java?

后端 未结 4 2006
無奈伤痛
無奈伤痛 2021-01-04 23:33

Specifically, in the case of object reference equality, what does the == operator do?

Does the comparison return true if the references evaluate to the same object a

4条回答
  •  -上瘾入骨i
    2021-01-05 00:30

    Because a reference is just a number, a reference comparison comes down to just comparing two numbers. No hash is needed.

提交回复
热议问题