`

Null Coalescing Operator (??) in C#

This is Null Coalescing Operator Example.

int b = a ?? -1;   

it means if the value of a is null then b=a other wise the value of b will be -1.

Simply this  mean

If (a == null)      
     b = a;   
Else   
   b = -1; 

Ebook Download
View all
Learn
View all