Top "Equals" questions

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

Getting an element from a Set

Why doesn't Set provide an operation to get an element that equals another element? Set<Foo> set = ...; ... Foo …

java collections set equals
What issues should be considered when overriding equals and hashCode in Java?

What issues / pitfalls must be considered when overriding equals and hashCode?

java overriding equals hashcode
How to determine equality for two JavaScript objects?

A strict equality operator will tell you if two object types are equal. However, is there a way to tell …

javascript object equals hashcode
How to check if my string is equal to null?

I want to perform some action ONLY IF my string has a meaningful value. So, I tried this. if (!myString.…

java string null equals conditional-operator
Why do I need to override the equals and hashCode methods in Java?

Recently I read through this Developer Works Document. The document is all about defining hashCode() and equals() effectively and correctly, …

java equals hashcode
Comparing two strings, ignoring case in C#

Which of the following two is more efficient? (Or maybe is there a third option that's better still?) string val = "…

c# string comparison equals
Difference between null and empty ("") Java String

What is the difference between null and the "" (empty string)? I have written some simple code: String a = ""; String b = …

java string null equals referenceequals
Compare two objects with .equals() and == operator

I constructed a class with one String field. Then I created two objects and I have to compare them using == …

java class object methods equals
Check if bash variable equals 0

I have a bash variable depth and I would like to test if it equals 0. In case yes, I want …

bash equals zero
Equals(=) vs. LIKE

When using SQL, are there any benefits of using = in a WHERE clause instead of LIKE? Without any special operators, …

sql performance equals sql-like