using System;
// c#-运算符-空合并运算符
namespace ConsoleApp9
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("空合并运算符");
int? a = null;
int b;
b = a ?? 10;
Console.WriteLine("b:"+b);
a = 3;
b = a ?? 10;
Console.WriteLine("b:"+b);
}
}
}
c#-运算符-空合并运算符(??)
最新推荐文章于 2024-01-03 11:45:08 发布