What is the integer reference type in C#?

前端 未结 8 1200
日久生厌
日久生厌 2021-01-11 12:46

I\'d like to have an integer variable which can be set to null and don\'t want to have to use the int? myVariable syntax. I tried using int and

8条回答
  •  天命终不由人
    2021-01-11 13:33

    Yes. That's why Microsoft added that. People were creating their own Nullable class so they included this pattern in .NET.

提交回复
热议问题