15
I see many third-party codes and I often see the use of the question mark on the type of the variable.
Example:
public bool? Status
Could someone explain to me the difference between not having this sign ?
in the data type bool.
15
I see many third-party codes and I often see the use of the question mark on the type of the variable.
Example:
public bool? Status
Could someone explain to me the difference between not having this sign ?
in the data type bool.
16
This is syntactic sugar for nullables (cancellable types). Equals:
public Nullable<bool> Status
It is a way for you to have a variable that can contain a null reference or a value. Types by value (integer, boolean, dates etc.), by default, cannot contain null references.
More information in the manual.
Browser other questions tagged c# .net typing
You are not signed in. Login or sign up in order to post.
Hmmm.... got good answer I will use this to be able to make comparisons of nulls. Thank you!
– Leandro Curioso