The operator's symbol is a double question mark (??).
The null coalescing operator tests the value of a variable to check if it is null. If the value is not null then the variable's value is returned unaffected. If the variable is null however, a substitute value is provided as a second operand.
nt? a = 10;
int? n = null;
int result;
result = a ?? -1; // result = 10
result = n ?? -1; // result = -1
Really Good One............dear...............
ReplyDelete