【Java】Java 语言学习笔记,
分享于 点击 15022 次 点评:223
【Java】Java 语言学习笔记,
想查看类对象的地址,但是toString() 方法又被重载的话,可以考虑下面的函数。
System.identityHashCode()
System.identityHashCode() will
get you the 'original' hash code. Uniqueness isn't necessarily guaranteed, note. The Sun JVM implementation will give you a value which is related to the original memory address for this object, but that's an implementation detail and you shouldn't rely on
it.
相关文章
- 暂无相关文章
用户点评