A curious C# syntax with a question mark

后端 未结 3 1211
遇见更好的自我
遇见更好的自我 2020-11-30 09:47
private enum E_Week
{
   Mon = 0,
   Tue,
   . . .
}

What does the following code mean?

E_Week? week= null;

Is it

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 10:24

    E_Week? is equivalent to Nullable

    See here for more information on Nullable types.

提交回复
热议问题