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 functional interface in javatpoint?

0 Answers  


Are arrays static in java?

0 Answers  


What is boolean example?

0 Answers  


How are this() and super() used with constructors in java programming?

0 Answers  


What's a method in programming?

0 Answers  


What is type conversion in java?

0 Answers  


class A{ some variables; public void a()throws Excepion1,Exception2{....} } class B extends A{ variables... public void a()throws E2,E3{.....} } Qns: here override of methods occurs or not,ore else wil give any compilation error or run properly..plz tell me briefly whts happening with the above codes....

4 Answers   Quinnox,


Can array grow dynamically in java?

0 Answers  


what is the diff b/w arraylist and vector?

6 Answers   Code Genesis, Genesis, Sprintine Labs,


What is passing parameters in java?

0 Answers  


EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

1 Answers   EDS,


Is list thread safe in java?

0 Answers  


Categories