页面

2010-12-12

Java Object Address

`Object.hashCode()' returns the address (maybe, just a relative address) of an object reference. However, if the `hashCode()' method is overridden, it returns something else than a pointer. Actually, there is no safe way to get the reference to an object in Java, but a safe way to check: ==. One always wishes to compare a reference with others when wants it, so why doesn't compare directly.

没有评论: