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 are peerless components?

0 Answers  


What is a ternary operator in java? What is an interface?

0 Answers  


define polymorphism in java

0 Answers  


How does a try statement determine which catch clause should be used to handle an exception?

2 Answers  


What is the integer of 16?

0 Answers  


what is object deep copy and shallow copy and why it is required?

2 Answers  


What are thread priorities and importance of thread priorities in java?

0 Answers  


What are the steps involved to create a bean?

0 Answers  


How to do encapsulation in java?

0 Answers  


Can a string be null?

0 Answers  


What is garbage collector?

0 Answers  


What do you understand by access specifiers in Java?

0 Answers   Genpact,


Categories