Top "Hashcode" questions

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

What exactly is bucket in hashmap?

Recently, in an interview I was asked, what exactly is a bucket in hashmap? Whether it is an array or …

java linked-list hashmap hashcode bucket
How to implement hashCode and equals method

How should I implement hashCode() and equals() for the following class in Java? class Emp { int empid ; // unique across all …

java equals hashcode
hashCode in case classes in Scala

I've read that Scala'a case class construct automatically generates a fitting equals and hashCode implementation. What does exactly the generated …

scala hashcode case-class
Why does String.hashCode() in Java have many conflicts?

Why does String.hashcode() have so many conflicts? I'm reading the String.hashCode() in jdk1.6, below is the codes public …

java string hashcode
Good GetHashCode() override for List of Foo objects respecting the order

EnumerableObject : IEnumerable<Foo> wraps a List<Foo> If EnumerableObject a.SequenceEquals( EnumerableObject b), then they are …

c# algorithm hashcode gethashcode
Testing string equality using hashCode()

Is there any reason why a Java string cannot be tested for equality using it's hashCode method? So basically, instead …

java string hashcode
What kind of hash algorithm is used for Hive's built-in HASH() Function

What kind of hashing algorithm is used in the built-in HASH() function? I'm ideally looking for a SHA512/SHA256 hash, …

hive md5 hashcode sha256
Are mutable hashmap keys a dangerous practice?

Is it bad practice to use mutable objects as Hashmap keys? What happens when you try to retrieve a value …

hash key hashmap hashcode mutable
What is the hashCode for a custom class having just two int properties?

In Java, I have a class that represents a point with int coordinates public class Point { int x = -1; int …

java equals hashcode
HashSet contains problem with custom objects

My Custom class that will be contained by HashSet public class Person { String name; int age; public Person(String name, …

java hashcode hashset