当我对我的课程进行逆向工程时,我得到以下信息:
public Nullable<bool> Correct { get; set; }
public Nullable<bool> Response { get; set; }
我编码:
public bool? Correct { get; set; }
public bool? Response { get; set; }
有人可以告诉我这两者之间是否有任何区别。我以前没有见过Nullable<bool>
,我不确定为什么它不只是创建一个“布尔”。
注意:我将编码更改为 bool?回应乔恩的评论