Hi, well i am unable to understand that why it is mandatory
to have same hashcode, if two objects are same?

Thanks in advance.

Answer Posted / prasanna

If two objects are equal then there hashcode must same.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why vector class is used?

546


What is the best definition for data?

523


How to do encapsulation in java?

574


How do you sort arrays in java?

528


Explain exception chaining in java?

611






What is nextline method in java?

566


What are the main differences between the java platform and other platforms?

533


What is nan inf?

509


What is local class in java?

524


How to implement an arraylist in java?

510


In java how do we copy objects?

553


Which data type is class in java?

553


How can I debug the Java security exceptions and AccessControlExceptions?

640


Can private class be extended java?

571


What are the methods used to implement for the key object in the hash map?

569