I think this example may help you:
A type with a null value can be used in the same way as a regular value type. In fact, implicit conversions are built in to convert between a variable with a null and non-empty value of the same type. This means that you can assign a standard integer with a zero number and vice versa:
int? nFirst = null; int Second = 2; nFirst = Second; // Valid nFirst = 123; // Valid Second = nFirst; // Also valid nFirst = null; // Valid Second = nFirst; // Exception, Second is nonnullable.
When looking at the statements above, you can see that a variable with a null value and an immutable variable can exchange values as long as a variable with a null value does not contain zero. If it contains null, an exception is thrown. To avoid throwing an exception, you can use the nullable HasValue property:
if (nFirst.HasValue) Second = nFirst;
As you can see, if nFirst matters, this will happen; otherwise assignment is skipped.
Sandy
source share