Default value of nullable types is null
suggest changepublic class NullableTypesExample
{
static int? _testValue;
public static void Main()
{
if(_testValue == null)
Console.WriteLine("null");
else
Console.WriteLine(_testValue.ToString());
}
}
Output:
null
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents