View Full Version : What is hashCode?
priya01
06-10-2016, 04:23 AM
What is hashCode?
Shivangi Panwar
07-27-2016, 11:26 PM
Hash Code is used for bucketing in hash implementation like hashmap, hashtable, hashset...
pxljobs
07-31-2016, 10:11 PM
Hash code is a code that identifies each object,not necessarily unique hash code is generally used for comparing objects, if two object of same type can have same hash code they said to be equal hash code is integer value this would be automatically generated by JVM.
raynowenhall
02-16-2017, 02:37 AM
Hi, HashCode is a mathematical formula that returns some integer value. This integer value is used as index in array.
Thanks!
_____
secdevops (https://www.checkmarx.com/2015/06/22/21-awesome-talks-and-resources-on-security-and-devops/)
tyagi
02-20-2017, 12:10 AM
A hashcode is a number generated from any object. This is what allows objects to be stored/retrieved quickly in a Hashtable. Imagine the following simple example: On the table in front of you you have nine boxes, each marked with a number 1 to 9.
Thank you~
HAPPY TO HELP YOU!
oleevia
03-14-2017, 12:21 AM
HashCode is a mathematical formula(there is no best hash function) that returns some integer value.
This integer value is used as index in array.
Example
hashCode(int value){
/*Some hash function computation goes here*/
return hash;
}
The hash is returned and now it acts as the index of the array. The value is inserted in that place. Now if you want to retrieve that value then you again use hashCode(val) and get the hash of value and directly take that value from index of array.
Well what happens if hashCode(val) returns index where the value is already inserted. This is called collision and some collision handling strategy is used(example separate chaining).
Qualities of good hash function
For same value the Hash function should return same hash
hash function should distributed the hash evenly across the array.
damponting44
11-17-2017, 12:43 AM
A hashcode is a number created from any question. This is the thing that enables articles to be put away/recovered rapidly in a Hashtable. Envision the accompanying basic case: On the table before you have nine boxes, each set apart with a number 1 to 9.
johnnymorgan
12-04-2017, 02:26 AM
Hash code is used for bucketing in hash execution like hashmap, hashtable, hashset.
traveloweb
01-09-2018, 03:30 AM
A hashcode is a number generated from any object. This is what allows objects to be stored/retrieved quickly in a Hashtable. Imagine the following simple example: On the table in front of you you have nine boxes, each marked with a number 1 to 9.
jackar56
02-06-2018, 07:42 AM
A hashcode() is a function that takes an object and outputs a numeric value. The hashcode for an object is always the same if the object doesn't change.
RH-Calvin
02-08-2018, 11:50 AM
A hash code is a numeric value that is used to insert and identify an object in a hash-based collection such as the Dictionary<TKey, TValue> class, the Hashtable class, or a type derived from the DictionaryBase class.
hariandro001
09-21-2018, 09:26 PM
A hash code is a numeric value that is used to insert and identify an object in a hash-based collection such as the Dictionary<TKey, TValue> class, the Hashtable class, or a type derived from the DictionaryBase class.
Exactly correct information. A hashcode is a numeral generated from whichever object. This is what permits objects to be saved / repossess promptly in a Hashtable.
hariandro001
09-21-2018, 09:38 PM
A hash code is a numeric value that is used to insert and identify an object in a hash-based collection such as the Dictionary<TKey, TValue> class, the Hashtable class, or a type derived from the DictionaryBase class.
Exactly correct information. A hashcode is a numeral generated from whichever object. This is what permits objects to be saved / repossess promptly in a Hashtable.
efusionworld
10-24-2018, 09:16 PM
A hash code is a numeric value that is used to identify an object during equality testing. To address the issue of integrity, it is common to make use of hash codes. The goal is for every object to return a distinct hash code, but this often cannot be absolutely guaranteed. That is, the default implementation of the GetHashCode() method does not guarantee unique return values for different objects.
vinayak
07-26-2019, 12:07 AM
Hash code in the .NET framework is a numeric value that helps in the identification of an object during equality testing and also can serve as an index for the object. The value contained in the hash code is not permanent in nature. The purpose of hash code is to help in efficient lookup and insertion in data collections which are based on a hash table.
harshal14
07-29-2019, 01:43 AM
A hash code is a numeric value that is used to insert and identify an object in a hash-based collection such as the Dictionary<TKey, TValue> class, the Hashtable class, or a type derived from the DictionaryBase class.
Powered by vBulletin® Version 4.2.2 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.