【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.


你可能感兴趣的:(【爪哇】,java,语言,object,jvm,sun)