110,539
社区成员
发帖
与我相关
我的任务
分享
int? a=0;
int b = (int)a;
int? n = null;
//int m1 = n; // Will not compile.
int m2 = (int)n; // Compiles, but will create an exception if x is null.
int m3 = n.Value; // Compiles, but will create an exception if x is null.
int? test = null;//定义一个int?赋值空
int a = test ?? 0;//test??0 当test不为空时,直接返回值,为空时返回??后的值