c#中的??运算浮

如果 "??"运算符的左操作数非空,该运算符将返回做操作数,否则返回右操作数

int y=x??-1

等价于

if(x != null ) y=x;

else y = -1; 

  

posted @ 2013-05-21 09:30  OpenSoucre  阅读(220)  评论(0编辑  收藏  举报