开发者

private int? _City_Id; can any one tell me what "?" means here

开发者 https://www.devze.com 2022-12-28 07:09 出处:网络
pr开发者_如何学Pythonivate int? _City_Id;Without knowing your target language to respond with, in C# 2.0 the ? denotes nullable value types.

pr开发者_如何学Pythonivate int? _City_Id;


Without knowing your target language to respond with, in C# 2.0 the ? denotes nullable value types.

Nullable value types (denoted by a question mark, e.g. int? i = null;) which add null to the set of allowed values for any value type.

Which, as Calum points out (all credit to him), means that the variable can be assigned null. Normally primitives like int and double can't be null,

int? x = 10;
double? d = 4.108
0

精彩评论

暂无评论...
验证码 换一张
取 消