Top "Hashcode" questions

A hash code is a result of applying a hash function to data, usually resulting in an integer.

Java Array HashCode implementation

This is odd. A co-worker asked about the implementation of myArray.hashCode() in java. I thought I knew but then …

java integer hashcode
toString(), equals(), and hashCode() in an interface

So, I have an interface with a bunch of methods that need to be implemented, the method names are irrelevant. …

java interface equals hashcode tostring
GetHashCode override of object containing generic array

I have a class that contains the following two properties: public int Id { get; private set; } public T[] Values { get; …

c# arrays generics hashcode
Internal implementation of java.util.HashMap and HashSet

I have been trying to understand the internal implementation of java.util.HashMap and java.util.HashSet. Following are the …

java hashmap hashcode hashset language-implementation
Java: Duplicate objects getting added to set?

If I run the below code then the output is 2 which means that the set contains 2 elements. However I think …

java hash hashcode hashset
Quick and Simple Hash Code Combinations

Can people recommend quick and simple ways to combine the hash codes of two objects. I am not too worried …

c# algorithm hash hashcode
Should I write equals() and hashCode() methods in JPA entities?

I want to check if entity is in a Collection member (@OneToMany or @ManyToMany) of another entity: if (entity2.getEntities1().…

java jpa entity equals hashcode
How do I calculate a good hash code for a list of strings?

Background: I have a short list of strings. The number of strings is not always the same, but are nearly …

.net database-design hashcode
Can Java's hashCode produce same value for different strings?

Is it possible to have same hashcode for different strings using java's hashcode function?or if it is possible then …

java hashcode
How can I do unit test for hashCode()?

How can I test the hashCode() function in unit testing? public int hashCode(){ int result = 17 + hashDouble(re); result = 31 * result + hashDouble(…

java unit-testing junit hashcode