| 1. |
How Does Get() Method Of Hashmap Works In Java? |
|
Answer» The GET() method of HashMap works in the principle of hashing. It is RESPONSIBLE for storing an object into BACKEND array. The hashcode() method is used in conjunction with a hash FUNCTION to find the correct location for the object into the BUCKET. If a collision occurs then the entry object which contains both key and value is added to a linked list and that linked list is stored into the bucket location. The get() method of HashMap works in the principle of hashing. It is responsible for storing an object into backend array. The hashcode() method is used in conjunction with a hash function to find the correct location for the object into the bucket. If a collision occurs then the entry object which contains both key and value is added to a linked list and that linked list is stored into the bucket location. |
|