What are uses of Hash Code?

Answer Posted / suraj kumar

1. When equals() method is invoked on java objects to check
their equality, then the hash code of objects are checked. The
two objects having same hash code are equal.
2. The objects having distinct hash code in HashTable
increases the performance of HashTable. Hence, the objects
should be checked its distinct hash code before storing into
HashTable.

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is treeset in java collection?

621


Can you explain inner class.

707


How many bytes is a url?

648


Can this keyword be used to refer static members?

631


What is your platform’s default character encoding?

649






What is <> used for in java?

762


How to convert string to byte array and vice versa?

668


What is an image buffer?

622


Difference between arraylist and vector.

693


What is passed by reference and pass by value ?

653


Explain a situation where finally block will not be executed?

670


What language is an assembler written in?

647


explain autoboxing in java?

680


What is a null class?

662


Describe what a thread-local variable is in java?

653