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

Can we change the value of static variable?

0 Answers  


What is comparator in java?

0 Answers  


Difference between object instantiation and construction ?

0 Answers  


Can we call virtual funciton in a constructor ?

0 Answers   XX,


what is features of jdk 1.5?

2 Answers   Accenture, Satyam, TCS,






What are autoboxing and unboxing? When does it occur?

0 Answers  


When you say String is immutable, what do you mean by that? Say I have String s = "Ness" s= s+"Technologies"; What will happen? If the value gets appended, then what is the meaning of immutable here?

5 Answers   Ness Technologies,


What is meant by string is immutable?

0 Answers  


What is collection api?

0 Answers  


Life Cycle of Thread

4 Answers   IBM,


Which is better singleton or static class?

0 Answers  


What is procedure overloading?

0 Answers  


Categories