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 OOP Language?

624


What is a website container?

499


How static variable work in java?

596


What is the method overriding?

614


What is the longest unicode character?

691






Is math an abstract class in java?

531


Can a class be private in java?

537


Is java se open source?

564


Can we convert stringbuffer to string?

561


Define inheritance with reference to java.

579


Why string is a class?

544


What is a linkedhashmap java?

545


Is array passed by reference in java?

578


What does pointer mean?

544


What are the classes of java?

537