The method System.identityHashCode(...)
is called that way, because it identifies objects, so two distinct objects can't have same identity-hashcode, right?
It returns an int
. But what happens, on a system with huge amount of RAM, when the number of objects exceeds the integer range 2^32
?
Wouldn't it be a problem for HashMap
s and HashSet
s when operating on classes which don't override equals
and hashCode
?
EDIT:
If int
is not enough, can I get some real unique ID for an object?