The hashtable knows this. It's not a direct mapping of hash code to value
... it's hash code to a linked list of values with the same hash code.
Hashtables are normally implemented this way, actually, and in a normal
hashtable implementation you will have a lot of different hashcodes sharing
the same linked list.
--John Keiser
> -----Original Message-----
> From: Reddy Ramakrishna [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 19, 1998 4:58 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Hashcode stuff ...
>
>
>
>
> Doesn't it create problems when you are trying to store two objects,
> whose truncated hashcodes are same, into the same hashtable ?
> Or the hashtable knows this and handles appropriately ??
>
> --
> ramky
>
> At 04:53 PM 10/19/98 -0700, [EMAIL PROTECTED] wrote:
> >Reddy Ramakrishna <[EMAIL PROTECTED]> writes:
> >>
> >> Can somebody explain me how japhar generates hashcode in
> java.lang.Object ?
> >> I would like to know the algorithm and where in japhar code I can find
> >> the implementation.
> >
> >java.lang.Object simply returns the address of the object, cast to a
> >32 bit int.
> >
> >this may involve truncating, but that isn't a problem, since it
> >doesn't matter if two objects have the same hashcode -- just that one
> >object always return the same hashcode.
> >
> >xtoph
> >
>
>