o is null
translated into object.Equals(null, o)
(you can see it here ).
The code is object.Equals
written as :
public static bool Equals(Object objA, Object objB)
{
if (objA == objB)
{
return true;
}
if (objA == null || objB == null)
{
return false;
}
return objA.Equals(objB);
}
therefore at the end will be o == null
(first if
). Please note that it System.Object
does not define operator==
, therefore, the one used for reference types is used, which is a reference equality.
, , , o == null
( o
a System.Object
) , o is null
( )... ?: -)
, o is null
o == null
( o
a System.Object
) .
, o == null
object.ReferenceEquals(o, null)
( o
a System.Object
): -).
, # x is null
object.ReferenceEquals(x, null)
?. , , , :
int? a = null;
if (a is null) { }
... "",