在.NET空整型整型、NET

2023-09-04 00:10:43 作者:一壶漂泊难入喉

什么是可空的整数,在那里能不能用?

what is the nullable integer and where can it be used?

推荐答案

可空整数 INT 可空< INT> 在C#中的值类型,其值可以是或整数值。它的默认值,而不是 0 ,并重新presenting有用的东西像值未设置(或任何你想让它重新present)。

The nullable integer int? or Nullable<int> is a value type in C# whose value can be null or an integer value. It defaults to null instead of 0, and is useful for representing things like value not set (or whatever you want it to represent).