Private int? _City_Id; can anyone tell me that "?" mean here

private int? _City_Id;

+3
source share
1 answer

Without knowing your target language for an answer, using C # 2.0 ? denotes types of valid values.

Invalid value types (indicated by a question mark, for example, int? I = null;) that add null to the set of valid values ​​for any value type.

Which, as Kalum points out (all of his loans), means that a variable can be assigned null. Typically, primitives of type intand doublecannot be null,

int? x = 10;
double? d = 4.108
+7
source

Source: https://habr.com/ru/post/1742285/


All Articles