Ili*_*oly 12
int
是一种原始类型,只有ReferenceType
s(对象)可以为空.您可以int
通过将其包装在对象中来使其可为空:
System.Nullable<int> i;
Run Code Online (Sandbox Code Playgroud)
-要么-
int? i;
Run Code Online (Sandbox Code Playgroud)
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/using-nullable-types