What is the purpose of a question mark after a type (for example: int? myVariable)?

問題:

Typically the main use of the question mark is for the conditional, x ? "yes" : "no"通常,問號的主要用途是用於條件x ? "yes" : "no" x ? "yes" : "no" . 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;
}

解決方案:

參考一: https://en.stackoom.com/question/BI14
參考二: https://stackoom.com/question/BI14
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章