Category "equals"

Can ReSharper generate equality members that correctly compare Collection members?

Say you have a class with members that are collections, such as. public class Forest { public IImmutableList<Tree> Trees { get; } . . . } When

Default implementation for hashCode() and equals() for record vs class in Java

Tried with sample code to check default behaviour of equals() and hashCode() for record vs class, but it seems behave differently for record compare to class. H

Strange value comparison issue in Kotlin, "===" returns true but "==" returns false

I have encountered a very strange value comparison issue in Kotlin that I cannot explain, the following code prints false data class Foo ( val a: Byte ) fun

LocalDate: equals vs isEqual

LocalDate in Java has two similar methods equals and isEqual. What's the difference between them? When do they output different results?

Path.equals behaves different on Windows and Linux

I use the following code to compare two Paths in Java: import java.nio.file.Paths; public class PathTest { public static void main(String args[]) { St

HashMap with List of Objects as a Key

in HashMap when I pass List of Objects as Key I get different results. List<NewClass> list1 = new ArrayList<>(); List<NewClass> list2 = new Ar

Overload equals of BigDecimal in Kotlin

In a Kotlin file I try to overload the equals method of the BigDecimal class. I have the following piece of code for that: fun BigDecimal.equals(n: Any?): Bool

how to override the equals() method when you have to compare 7 instance variables? [duplicate]

I am currently doing my programming assignment. But there is one step that i don't quite understand. There are 7 private instance variables an