Difference between hashCode() & equals()?

Answers were Sorted based on User's Feedback



Difference between hashCode() & equals()?..

Answer / rohan

equals() method of string class compares the contaits of string
equals() method of object class compares the address of objects
Hashcode() method returns the unique identification code of
particular object.

Is This Answer Correct ?    4 Yes 0 No

Difference between hashCode() & equals()?..

Answer / srikanth

hashCode() method returns integer no assigned by jvm
ie ...it is for identifying objects in heap memory very
fastly

equals() it is for comparing addreess of objects

Is This Answer Correct ?    4 Yes 2 No

Difference between hashCode() & equals()?..

Answer / srikanth

hashCode() method returns integer no assigned by jvm
ie ...it is for identifying objects in heap memory very
fastly

equals() it is for comparing addreess of objects

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More Core Java Interview Questions

What is the life-cycle of an object?

2 Answers   Broadridge, Syntel,


how can i use a nonsynchronized hashtable?

0 Answers   CoreObjects,


Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.

0 Answers  


Why are the methods of the Math class are static?

1 Answers  


What is flush () in java?

0 Answers  






if two references are having same hash codes,is that means those are refering to same object?

5 Answers   CTS,


Write code of any action class?

0 Answers  


Does 'true' and 'false' are keywords?

5 Answers  


What do you mean by byte code?

0 Answers  


Can we clone singleton object in java?

0 Answers  


what is ejb? what is the importance of ejb?

2 Answers   Photon,


What are the advantages of exception handling in java?

0 Answers  


Categories