开发者

Can you set an Integer to be null in C# 2.0?

开发者 https://www.devze.com 2023-01-08 08:48 出处:网络
Can you set an Integer to be null in C# 开发者_JAVA技巧2.0?I am assuming you are using c# 2.0 & .net framework 2.0 onwards.

Can you set an Integer to be null in C# 开发者_JAVA技巧2.0?


I am assuming you are using c# 2.0 & .net framework 2.0 onwards.

Use nullable types for that. e.g. int? myValue = null;
or Nullable<int> myOtherValue = null;

EDIT: See an example here.

0

精彩评论

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