Example of Null Coalescing Operator -> If the value of first operand is null, then the operator returns the value of the second operand, otherwise
it returns the value of the first operand.
double? dnf1 = null;
double? dnf2 = 1.18;
double? dnf3;
dnf3 = dnf1 ?? 2.16;
Console.WriteLine("Value of dnf3", dnf3);
dnf3 = dnf2 ?? 2.16; //null coalesing operator
Console.WriteLine("dnf3:", dnf3);
Output:
Value of dnf3 2.16
dnf3:1.18