作者cplusplus (C++)
看板java
标题Re: [问题] Object
时间Sun Feb 12 14:19:07 2006
※ 引述《[email protected] (上B只为剿小白出气!)》之铭言:
: ※ 引述《mojo (我们是爱国斗士)》之铭言:
: : 记忆体位址啦 喔啦啦啦!!!!!!
: 鬼扯...
基本上他说得没错唷 如果hashcode没有特别实做的话 会直接继承parent class的
Object的hashcode实做就是直接传回记忆体位址...所以後面那一串的确是记忆体位址
As much as is reasonably practical, the hashCode method defined by class Object
does return distinct integers for distinct objects. (This is typically
implemented by converting the internal address of the object into an integer,
but this implementation technique is not required by the JavaTM programming
language.)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.217.14