1. What if there is no value?
The customer placed an order with an order date but not yet delivered, but there was no delivery date. How can we express the delivery date? C #2 and later can be empty type.
2. Why cannot a value-type variable be null?
A reference type variable whose value is a reference. That is, a non-null reference value provides a way to access an object. For null, being a special value means that no object is referenced. All referenced default values are null, indicating that all values are zero in memory.
Value Type Variable. Its value is its actual data. Null is not a valid value.
3. C #1 solve the non-null type
Magic value: datetime, at the expense of a value datetime. minvalue in the first year of the year.
Reference Type packaging: requires packing and unpacking
Extra Boolean flag: It is generally used to encapsulate the value and flag into another value type.
4. system. nullable <t> and system. nullable
Nullable <t> is a generic type and T has a value type constraint. Therefore, nullable <stream> or nullable <nullalbe <int> cannot be used. It has two important attributes: hasvalue and value. Nullable <t> is still a value type.
? Modifier: Int? Nullable = 5;
Use the as operator for the null type: null or meaningful value.