Wednesday, September 20, 2017

syntactic sugar for nullable types in C#

What's the difference between...

DateTime? itsYourBirthday = null;

 
 

...and...

Nullable<DateTime> itsYourBirthday = null;

 
 

...in C#? Nothing? There is no difference. This says: "The former is syntactic sugar for the second."

No comments:

Post a Comment