问号后一类的目的是什么(例如:INT myVariable的)? [英] What is the purpose of a question mark after a type (for example: int? myVariable)?

查看:310
本文介绍了问号后一类的目的是什么(例如:INT myVariable的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常主要使用的问号是有条件的,X? 是:无

不过,我看到有其他的用途,但无法找到该使用的解释?操作者,例如

 公众诠释? myProperty的
  {
   得到;
   组;
  }
 

解决方案

这意味着,在讨论的价值类型为的可空类型

typically the main use of the question mark is for the conditional, x ? "yes" : "no".

But I have seen another use for it but can't find an explanation of this use of the ? operator, for example.

public int? myProperty
  {
   get;
   set;
  }

解决方案

It means that the value type in question is a nullable type

这篇关于问号后一类的目的是什么(例如:INT myVariable的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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