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 there be an abstract method without an abstract class?

0 Answers  


Which keyword specify that a variable is effectively final ?

0 Answers  


What is a prefix function.write down a code to compute prefix function.

0 Answers  


why java does not contain pointers?

13 Answers   Infosys, TCS,


What is the use of http-tunneling in rmi?

0 Answers  






Write a program for recursive Traverse?

1 Answers  


How many bits is a string in java?

0 Answers  


Give the difference between the println method and sqrt method?

0 Answers  


What is the difference between C++ and Java and your preferences?

0 Answers   Expedia,


How long will it take to learn java?

0 Answers  


How hashmap increases its size in java?

0 Answers  


What Is Resource Leak?

2 Answers  


Categories