using System; public class HelloWorld { public static void Main() { //null合并运算符 string s1 = null; string s2 = s1 ?? "nothing"; // s2 evaluates to "nothing" //null条件运算符 System.Text.StringBuilder sb = null; string s = sb? .ToString(); // No error; s instead evaluates to null } }