相关疑难解决方法(0)

为什么不递增Nullable <int>抛出异常?

你能解释一下,为什么Console.WriteLine写空行(Console.WriteLine(null)给我编译错误)以及为什么没有NullReferenceException(甚至a+=1不应该提高它)?

int? a = null;
a++; // Why there is not NullReferenceException? 
Console.WriteLine(a); // Empty line
Run Code Online (Sandbox Code Playgroud)

.net c# nullable

97
推荐指数
2
解决办法
5618
查看次数

标签 统计

.net ×1

c# ×1

nullable ×1