The question mark represents a weak type in C. Nullable is a new technique provided in. NET 2.0 to indicate whether a value type can be empty.
For a type, if you can either assign a value to it or assign a null reference to it (indicating that there is no value), we can say that this type can be empty.
The following describes how to use question marks:
A. The variable definition contains a question mark, which indicates that the data type is nullable. When you set an initial value for a variable, assign null to the variable (INT type) instead of 0!
Example: Int? X = 125 is equivalent to nullable <int> X = new nullable <int> (125 );
B. The variable definition contains two question marks, which are used to determine and assign values. First, it determines whether the current variable is null. If yes, it can be assigned a new value. Otherwise, it will be skipped! What does it mean to take the assigned value ?? On the left, if the left is null, the assigned value is used ?? On the right.
Example: Page ?? 0 indicates that when page is null, the value on the right is 0.