Open layris3 opened 4 years ago
the null-coalescing operator defines a default value for a nullable type; for example, void SampleMethod(int? x) { int y; y = x ?? 1; }
void SampleMethod(int? x) { int y; y = x ?? 1; }
the expression y = x ?? 1;means return the value of x if it has value,or return 1 if x is null
y = x ?? 1;
the null-coalescing operator defines a default value for a nullable type; for example,
void SampleMethod(int? x) { int y; y = x ?? 1; }
the expression
y = x ?? 1;
means return the value of x if it has value,or return 1 if x is null