Top "Equals" questions

Refers to Java equals method, indicating whether some object is "equal to" this one.

Using == operator in Java to compare wrapper objects

I'm reading SCJP Java 6 by Kathy Sierra and Bert Bates and this book is confusing me so much. On page 245 …

java integer wrapper equals operator-keyword
C# - compare two SecureStrings for equality

I have a WPF application with two PasswordBoxes, one for the password and another for the password to be entered …

c# passwords equals securestring passwordbox
java.lang.Comparable and equals

If I implement java.lang.Comparable for a class, do I still have to override the equals() method? Or will …

java equals comparable
Operator Overloading with Interface-Based Programming in C#

Background I am using interface-based programming on a current project and have run into a problem when overloading operators (specifically …

c# .net operator-overloading equals
Force a class to override the .equals method

I have a bunch of class who implement a common interface : Command. And this bunch of class goes to a …

java interface overriding equals requirements
Why should I override hashCode() when I override equals() method?

Ok, I have heard from many places and sources that whenever I override the equals() method, I need to override …

java equals hashcode
Why it is implied that objects are equal if compareTo() returns 0?

Let's have a class Person. Person has a name and height. Equals and hashCode() takes into account only name. Person …

java collections equals comparable compareto
Difference between == operator and Equals() method in C#?

What is the difference between == and Equals() with example? I know that == is used to compare operator and Equals() method …

c# string equals equals-operator
Prevent stubbing of equals method

I would like to test my class' equals() method but Mockito seems to be calling the stub version every time. …

methods mocking mockito equals stub
Enabling IntelliJ's fancy ≠ (not equal to) operator

I witnessed this in the GOTO 2016 • Kotlin - Ready for Production conference by Hadi Hariri. In some of his code, …

intellij-idea formatting equals code-formatting