Possible Duplicate:
The type ‘string’ must be a non-nullable type in order to use it as parameter T in the generic type or method ‘System.Nullable<T>’
As the title says, why are strings nullable by default in C#, but if I want, say, ints or doubles to be null, I have to explicitly say so?
Because string is a reference type, deriving from object
and [most] other default types are value types, deriving implicitly from System.ValueType;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With