java hashCode() function on reference variable and objects -
for example, if create type object,
a = new a();
then reference on stack points a type object on heap. question is, if call a.hashcode(), one's hash code returned, hashcode of reference or hashcode of object? if hashcode of object, how can hashcode of reference? kindly give me tips plz?
hashcode()
non-static method, other non-static method. it's either defined a
, or base class of a
(object
, in worst case). happens method gets called on instance in question.
how can hashcode of reference?
you can't, because doesn't make sense.
Comments
Post a Comment