Null Coalescing Operator
using System;
class MainClass
{
static void Main()
{
int? nullableInteger = null;
Console.WriteLine("nullableInteger: {0}", nullableInteger ?? -1);
nullableInteger = 10;
Console.WriteLine("nullableInteger: {0}", nullableInteger ?? -1);
}
}
Output nullableInteger: -1
nullableInteger: 10
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
|