开发者

What is the difference between float and float? return type in C# property [duplicate]

This question already has answers here: 开发者_运维百科 Closed 12 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜