Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jun 28, 2022, 2:28 PM EDT
The ReferenceEquals() method - checks if two reference type variables(classes, not structs) are referred to the same memory address.
The virtual Equals() method. (System.Object) - checks if two objects are equivalent.
The static Equals() method - is used to handle problems when there is a null value in the check.
The Equals method from IEquatable interface.
The comparison operator == - usually means the same as ReferenceEquals, it checks if two variables point to the same memory address. The gotcha is that this operator can be override to perform other types of checks. In strings, for instance, it checks if two different instances are equivalent.
Sachin SinghRank #66 · 26.2K reputationPosted Jun 28, 2022, 11:47 AM EDT