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

What is use of map in java?

0 Answers  


Why stringbuilder is not thread safe in java?

0 Answers  


What is abstraction in java?

0 Answers   Akamai Technologies,


where exactly collections are usefull in realtime

2 Answers  


What is a constructor overloading in java?

0 Answers  






What do you understand by weak reference?

0 Answers  


What do u mean by variable?

0 Answers  


What are the types of java languages?

0 Answers  


Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.

9 Answers  


What are the types of statement? explain

1 Answers   SysBiz,


What is a list in java?

0 Answers  


What are the advantages of java over cpp?

0 Answers  


Categories