I understand from this post that value types in C# are not objects. That is, they do not inherit from System.Object.
Assuming my logic holds up to this point, are nullable types, such as int?, objects. Do they inherit from Object?
If so, are they subject to all the same rules and constraints as other objects, or are there special rules governing their behavior?
Just as reference, this question comes from an inquiry into the workings of the null coalesce operator.
Incorrect – value types are objects, but they don’t behave the same as reference types – they are pass-by-value, instead of pass-by-reference. So,
Nullable<T>(which is whatT?is) is a struct, and so inherits from System.ValueType and System.Object. There is Magic in the C# compiler that makes nullable types behave the same way as reference types with regards to null and ??, but they always have copy-by-value semantics.