1) In 1 If one of the operands is Null Or both Null , The result is Null .
For example:
Int? A = NULL;
Int? B = a + 3;
ThenBIsNull
2)When the comparison can be empty, as long as one operand isNullAnd the result isFalse
For example:
Int? A = NULL;
Int? B = 8;
(A> = B)ReturnsFalse
BecauseNullTherefore, you cannot compare an empty type with a non-empty type.
3)Null join Operator
Null join Operator "??" This parameter is used to process null and reference types. Null The possibility of a value provides a shortcut, maybe we don't need to always write If (XX! = NULL) . A bit similar to a ternary Operator "? :" , If "??" The previous number (the first number must be null or the reference type) is not Null, The expression value is the value of the first operand. If the first operand is Null The value of the expression is the value of the second expression.
For example:
Int? A = NULL;
Int defaut = 1010;
Int B;
B = ?? Defaut ;//In this caseBFetchDefautValue
A = 8;
B = ?? Defaut; // B A value
Of course, here the second number should be the same as the first number type or be implicitly converted to the first number.
PS:An empty type based on the reference type cannot be created because the reference type is supported.Null Value.