c# question mark after type code example
Example 1: c# double question mark
int? a = null;
int b = a ?? -1; // Same as b = ( a != null ? a : -1 );
Console.WriteLine(b); // output: -1
//OR IF
int? a = 9;
int b = a ?? -1;
Console.WriteLine(b); // output: 9
Example 2: c# question mark
FileInfo fi = ...; // fi could be null
long? length = fi?.Length; // If fi is null, length will be null