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 |
Why is the singleton pattern considered to be an anti pattern?
What is an off by one error in java?
Can a main method be overloaded?
What is the technique adopted to create an immutable class?
What is nextline method in java?
What does index mean in java?
In case of inheritance what is the execution order of constructor and destructor?
Can a final method be overloaded?
What is the benefit of inner classes in java?
Why do we use public static with the main function in Java?
13 Answers College School Exams Tests, Infosys,
Any one can explain how the inerface uses in java. give with example.
write a program that list all permutations of ABCDEF in which A appears before B?