What is the difference between float and float? return type in C# property [duplicate]
Possible Duplicate:
What does “DateTime?” mean in C#?
Hi All, I recently came across with some code in C# where float? is used as return type. I want to know what is the concept behind using this and in which scenario we need to use it against normal float return type.
Thanks
float? means Nullable<float>. Basically it is a wrapper for value types. By using it you are able to assign null to variable, which is not possible when it comes to value types.
float? is nullable
See http://msdn.microsoft.com/en-us/library/1t3y8s4s(VS.80).aspx
精彩评论