Samrat Som wrote:Buckets are basically a data structure that is being used in the Paging algorithm of the Operating System . To be in a very Laymans language.
2.The objects representing a particular hashcode is being stored in that bucket.(basically you can consider the header of the linked list data structure to be the hashcode value which is represented in the terms of bucket)
3.The references of the object is being stored in the link list , whose header represents the value of the Hashcode.
4. The JVM creates them and the size, depends upon the memory being allocated by the JVM.
I hope I have tried to clear your doubts.
but it uses instanceof in a non-final class in its equals() method.
Considering the different approaches and their respective up- and downsides it should by now be clear that none of the solutions is the silver bullet. There is not easy recipe for doing this. A designer of a new class must carefully evaluate the intended and required semantics of the class in order to come to a decision regarding the right implementation of equals() (and other pieces of basic infrastructure not discussed in this article). Here are some guidelines for class designers:
Campbell Ritchie wrote:Have you read the API documentation?
The only reason i could think of for multiple objects to map into same bucket is when their hashcode values are same? Am i right ??