問號和點運算符是什么?在C#6.0中意味著什么?在VS2015預覽版中使用C#6.0,我們有一個新的運算符,?.可以像這樣使用:public class A { string PropertyOfA { get; set; }}...var a = new A();var foo = "bar";if(a?.PropertyOfA != foo) { //somecode}它到底是做什么用的?
- 3 回答
- 0 關注
- 1107 瀏覽
添加回答
舉報
0/150
提交
取消