Default value of nullable types is null C# with Example



Default value of nullable types is null C# with Example

public class NullableTypesExample 
{ 
static int? _testValue; 
public static void Main() 
{ 
if(_testValue == null) 
Console.WriteLine("null"); 
else 
Console.WriteLine(_testValue.ToString()); 
} 
} 
Output: 
null 
 

0 Comment's

Comment Form

Submit Comment