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

Answers were Sorted based on User's Feedback



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

Answer / aparna

no.they need not b referin 2 same obj.if 2 references
pointng to same obj then also the hascode may same or maynt
same.its totally depends on JVM.

Is This Answer Correct ?    7 Yes 1 No

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

Answer / dheerendra

If two objects are same then on equals obj1.equals(obj2)
return true as well as the hashCode will also be same but if
the hashCode of two objects are same then it is not sure
that objects would point to same reference.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / ravurivinod

Thank you Aparna
for your feed back

Is This Answer Correct ?    0 Yes 0 No

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

Answer / dimpu

thanks for ur answer aparna

Is This Answer Correct ?    0 Yes 0 No

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

Answer / rajender

i agree with anuradha answer.but we can implement hashcode
method.in case of strings they implemented hashcode

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

where is .equals() method and how is it different from == operation <giving some confusing implementation> Is hashing related to these?

4 Answers   iFlex,


what is encapsulation in java? Explain

0 Answers  


What is a line break?

0 Answers  


how a marker interface gets its functionality and when we implements a marker interface how it got invoked

3 Answers   Mind Tree,


What will happen when using pass by reference in java?

0 Answers   HCL,


Can a class be subclass of itself?

4 Answers  


Does chrome use java?

0 Answers  


What do you understand by the term singleton?

0 Answers  


Can we compare two strings in java?

0 Answers  


What is a pointer and does java support pointers?

0 Answers  


Why do we need singleton class?

0 Answers  


What is split return?

0 Answers  


Categories