- Learn C# in 7 days
- Gaurav Aroraa
- 79字
- 2021-07-08 09:51:26
Null type
Nullable types are nothing but an instance of the System.Nullable<T> struct. The nullable type contains the same data range as that of its ValueType but with addition to a null value. Refer to the data type table where int has a range of 2147483648 to 2147483647 but System.Nullable<int> or int? has the same range in addition to null. This means you can do this: int? nullableNum = null;.
For more detail on nullable types, refer to https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/.