Difference between hashCode() & equals()?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the life-cycle of an object?
how can i use a nonsynchronized hashtable?
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
Why are the methods of the Math class are static?
What is flush () in java?
if two references are having same hash codes,is that means those are refering to same object?
Write code of any action class?
Does 'true' and 'false' are keywords?
What do you mean by byte code?
Can we clone singleton object in java?
what is ejb? what is the importance of ejb?
What are the advantages of exception handling in java?