Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. it depends on the implementation of equals method of the respective class. If no definition is provided and it uses the default definition of the object class, two references are equal only if they point to the same object. We can have such an equality defined for a particular class objects if we provide appropriate implementation of equals method comparing all those fields. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  equals  equals method | ||||
Related Questions | ||||
Difference between == and .equals() ? | ||||
Which String class does not override the equals() and hashCode() methods, inheriting them directly from class Object? | ||||
Can we compare Integers by using equals() in Java ? | ||||
Write a class and override the equals and hashcode method ? | ||||
What is equals method in Java ? | ||||
What is a reflexive equals contract ? | ||||
Explain Transitive equals contract. | ||||
why is "".equals(str); safer than str.equals("")? | ||||
Difference between equals and compareTo in Java ? | ||||