mursaleen fayyaz

mursaleen fayyaz

  • NA
  • 84
  • 125.2k

Null coalescing Operator

Jun 3 2013 1:28 PM
  • If the first operand is not null, then the overall expression has the value of the first operand.
  • If the first operand is null, then the overall expression has the value of the second operand.


For example:

int? a = null;

int b;

b = a ?? 10;        //b = 10

a = 3;

b = a ?? 10;        //b = 3