Difference between hashCode() & equals()?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why generics are used in java?

545


Why do we need singleton class?

545


How we can declare a static variable?

645


If a class is declared without any access modifiers, where may the class be accessed in java programming?

649


What is a container in a gui?

536






Is zero a positive integer?

524


How to create a thread in java?

596


What is return code?

552


What are the advantages of exception handling in java?

644


Which of the following classes will have more memory allocated?

577


Explain some best practices you would apply while using collection in java?

558


How can you say java is object oriented?

583


What does the exclamation mark mean in java?

586


What is a newline character in java?

562


What is the difference between Java1.4 and Java1.5

1822