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

When parseint method can be used?

543


What is difference between adapter class and listener?

501


Why hashset is used in java?

538


Can an interface have a constructor?

515


What’s the difference between constructors and other methods?

532






What is an array in java?

640


What restrictions are placed on method overriding in java programming?

544


How do you add an arraylist to an array in java?

511


Are private methods final?

488


How do you compare two objects?

524


Explain about sets?

570


What is static method with example?

620


What is a class in java?

582


What is the difference between overriding & overloading?

566


extending thread class or implementing runnable interface. Which is better? : Java thread

566