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

What is the static keyword?

776


What are the topics in core java?

755


What is immutable class in java?

684


What is user defined exception in Java?

810


Can we write any code after throw statement?

794


How will you reverse a singly-link list?

756


What is join () in java?

701


Can substring create new object?

753


What is a line break?

772


What is static class

801


How do you compare objects in java?

680


What is the purpose of the system class in java programming?

729


How do I compare two strings in word in java?

727


Why is string buffer better than string ?

774


What is a flag and how does it work?

694