Determines whether two object references are identical.
- objA
- Documentation for this section has not yet been entered.
- objB
- Documentation for this section has not yet been entered.
True if a and b refer to the same object or are both null references; otherwise, false.
C# Example
using System;
class MyClass {
static void Main() {
object o = null;
object p = null;
object q = new Object();
Console.WriteLine(Object.ReferenceEquals(o, p));
p = q;
Console.WriteLine(Object.ReferenceEquals(p, q));
Console.WriteLine(Object.ReferenceEquals(o, p));
}
}
The output is
True