作者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