Top "Equals" questions

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

How to compare two NSArrays for equal content?

I have 2 Nsarray where objects of 2 arrays are same may be indexes of the object differs, but it should print …

objective-c ios nsmutablearray nsarray equals
How to prevent null check before equals

I find stuff like this rather annoying and ugly in equals methods: if (field == null) { if (other.field != null) return …

java equals code-cleanup
Java Hashset.contains() produces mysterious result

I don't usually code in Java, but recently I started not having a choice. I might have some major misunderstanding …

java equals hashcode contains hashset
Is there a complete IEquatable implementation reference?

Many of my questions here on SO concerns IEquatable implementation. I found it being extremely difficult to implement correctly, because …

c# .net equals gethashcode iequatable
Comparing doubles in Java gives odd results

I really can'get my head around why the following happens: Double d = 0.0; System.out.println(d == 0); // is true System.out.…

java double equals autoboxing
How does compareTo work?

I know that compareTo returns a negative or positive result on how well one string correlates to the other, but …

java equals comparable compareto
Compare two Java Collections using Comparator instead of equals()

Problem Statement I have two Collections of the same type of object that I want to compare. In this case, …

java collections equals comparator
Is it possible in java make something like Comparator but for implementing custom equals() and hashCode()

I have an array of objects and I want to concatenate it with another array of objects, except that objects …

java collections equals hashcode
When "" == s is false but "".equals( s ) is true

EDIT Thanks for the prompt responses. Please see what the real question is. I have made it bold this time. …

java comparison equals equality
What's wrong with defining operator == but not defining Equals() or GetHashCode()?

For the code below public struct Person { public int ID; public static bool operator ==(Person a, Person b) { return a.…

c# warnings equals equals-operator