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 are peerless components?
What is a ternary operator in java? What is an interface?
define polymorphism in java
How does a try statement determine which catch clause should be used to handle an exception?
What is the integer of 16?
what is object deep copy and shallow copy and why it is required?
What are thread priorities and importance of thread priorities in java?
What are the steps involved to create a bean?
How to do encapsulation in java?
Can a string be null?
What is garbage collector?
What do you understand by access specifiers in Java?