Hi, well i am unable to understand that why it is mandatory
to have same hashcode, if two objects are same?

Thanks in advance.

Answer Posted / venkateswara reddy

NO No NO....
Check it once..
If there r two same objects, there must be a diffent
hashcode to them....
U never find same hashcode to any two objects

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the interface be final?

780


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

904


How is hashcode calculated in java?

734


What are structs in java?

816


Why do we override tostring method in java?

699


Can we execute java program without main method?

748


Is it possible to compare various strings with the help of == operator? What are the risks involved?

859


Explain the features of interfaces in java?

764


which class is the wait() method defined in? : Java thread

732


when to use ArrayList and when to use HashMap in webApplication.

4255


Can we create a constructor in abstract class?

775


What is variable and constant explain with example?

779


What are the advantages and disadvantages of object cloning?

798


What are the differences between throw and throws?

853


What is the purpose of the system class in java?

787