Re: [問題] Object
※ 引述《Contactman.bbs@bbs.badcow.com.tw (上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
java 近期熱門文章
PTT數位生活區 即時熱門文章