Nullable Data Types

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

Is there a list of which data types are nulable?

I know bool is: bool? published;

But what about DateTime, Double, etc ...

I know string is not ...

Thanks,
Miguel
 
*Any* value-type (except Nullable<T> itself) can be used as a nullable
type, simply by appending with ?

This is short-hand for Nullable<T>, which has the generic type
constraint "T : struct".

String is a reference-type, so can be null without needing Nullable<T>.

Marc
[C# MVP]
 
Back
Top