Top "Hashcode" questions

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

How to write hashCode method for a particular class?

I'm trying to generate a hashCode() method for my simple class but i'm not getting anywhere with it. I would …

java class character hashcode compareto
What is an object's hash code if hashCode() is not overridden?

If the hashCode() method is not overridden, what will be the result of invoking hashCode() on any object in Java?

java object hashcode
Why should I override hashCode() when I override equals() method?

Ok, I have heard from many places and sources that whenever I override the equals() method, I need to override …

java equals hashcode
Boolean.hashCode()

The hashCode() method of class Boolean is implemented like this: public int hashCode() { return value ? 1231 : 1237; } Why does it use 1231 and 1237? …

java boolean hashcode
How do I create a HashCode in .net (c#) for a string that is safe to store in a database?

To quote from Guidelines and rules for GetHashCode by Eric Lippert: Rule: Consumers of GetHashCode cannot rely upon it being …

c# .net database hashcode gethashcode
Lombok.hashCode issue with "java.lang.StackOverflowError: null"

I have two tables has one to one relationship as below: @Entity @Data @NoArgsConstructor @AllArgsConstructor public class Book { @Id @GeneratedValue(…

hashcode lombok
A quick string checksum function in Perl generating values in the 0..2^32-1 range

I'm looking for a Perl string checksum function with the following properties: Input: Unicode string of undefined length ($string) Output: …

perl string checksum cpan hashcode
Java - TreeSet and hashCode()

I have a quick question about TreeSet collections and hashCode methods. I have a TreeSet and I'm adding objects to …

java hashcode treeset
How does the JVM ensure that System.identityHashCode() will never change?

Typically the default implementation of Object.hashCode() is some function of the allocated address of the object in memory (though …

java jvm hashcode heap-memory
Is there a way to auto-generate GetHashCode and Equals with ReSharper?

In eclipse, when I code in Java, there is a feature to auto-generate a basic, efficient, and bug free implementation …

.net visual-studio resharper equals hashcode