object
and string
are reference types, so they're already nullable. For example, this is already valid:
string x = null;
The Nullable<T>
generic type is only for cases where T
is a non-nullable value type.
In the declaration for Nullable<T>
there is a constraint on T
:
public struct Nullable<T> where T : struct
That where T : struct
is precisely the part that constrains T
to be a non-nullable value type.