Hi all,
In kathy sirrae and bertbates
scjp 1.6,page no:585.there are two hashCode snippets as follows.
in the above 2 snippets he gave first one is efficent(fast)
reason:the first hashCode generate different code for each name length.
the second hashcode forumla woill always produce same result 4 so it will be slower than the first
my understanding of above reason is if the fist code is used the objects will stored in diff bugets so while retrieving it is easy.
in the second code every object will generate same hashCode so all objects will be stored in the same bucket,while retrieving it will take
time.so fist is better. am i right??
please some body explain me if i am wrong.