Object.Equals Method (Object, Object)
Determines whether the specified object instances are considered equal.
Assembly: mscorlib (in mscorlib.dll)
The first object to compare.
The second object to compare.
Return ValueType: System.Boolean
true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.
The static null for equality. It compares objA and objB for equality as follows:method indicates whether two objects, objA and objB, are equal. It also enables you to test objects whose value is
It determines whether the two objects represent the same object reference. If they do, the method returns true. This test is equivalent to calling the ReferenceEquals method. In addition, if both objA and objBare null, the method returns true.
It determines whether either objA or objB is null. If so, it returns false.
If the two objects do not represent the same object reference and neither is null, it calls objA.Equals(objB) and returns the result. This means that if objA overrides the Object.Equals(Object) method, this override is called.
Available since 4.5
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1