What is hash code collision?



What is hash code collision?..

Answer / Pundreekaksha Sharma

"Hash Code Collision occurs when two objects with different values have the same hash code. Hash codes are used by data structures like HashMaps to quickly access an object based on its key.nWhen a collision happens, the data structure needs to use additional methods to handle it, such as chaining or open addressing."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

how to get the max salary and name of employee from arraylist without using the Comperator or even Comparable interface?

2 Answers  


why java is better then .net?

5 Answers   HCL, iGate,


in a console we r giving java <class name> if r pressing enter where it'll goes

2 Answers   CSC,


Why is java logo a cup of coffee?

1 Answers  


What is OOPs & Why?

3 Answers  


Is it safe for adding 10,00,000 records/objects to HashMap?, i.e is it safe to add millions of objects to HashMap?

2 Answers  


What is user defined exception?

4 Answers  


When finalize method is called?

3 Answers  


What is a lambda expression ? What's its use ?

1 Answers  


ublic class Java_Coding_Samples { public static void JavaHungr(NumberFormatException ae){ System.out.println("integer"); } public static void JavaHungry(Exception e){ System.out.println("string"); } public static void JavaHungry(ArithmeticException ae){ System.out.println("object"); } public static void main(String[] args) { JavaHungry(null); }

1 Answers  


What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?

1 Answers  


What is java dot?

1 Answers  


Categories