.NET 中的可空整数 [英] Nullable integer in .NET

查看:19
本文介绍了.NET 中的可空整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是可为空的整数?它可以用在什么地方?

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

推荐答案

可空整数 int?Nullable 是 C# 中的值类型,其值可以为 null 或整数值.它默认为 null 而不是 0,并且对于表示诸如 value not set(或您希望它表示的任何内容)之类的内容很有用.

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).

这篇关于.NET 中的可空整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆