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

Can a static method be overridden in java?

644


Why is String immutable?

710


What do you mean by inner class in java? Explain

697


What is the purpose of javac exe?

650


Is java free for commercial?

576






What is the primary benefit of encapsulation?

655


What is the Difference between Final Class && Abstract Class?

710


Explain when noclassdeffounderror will be raised ?

712


Can we have any other return type than void for main method?

638


What are the data types supported by java? What is autoboxing and unboxing?

644


What’s the difference between constructors and other methods?

625


What is compareto?

636


Write a method that will remove given character from the string?

662


What is files manifesting?

1842


what do you mean by classloader in java?

677