"??"是什么意思?吝啬的? [英] What does "??" mean?

查看:73
本文介绍了"??"是什么意思?吝啬的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看ASP.NET MVC 1.0生成的代码,并且想知道;双重问号是什么意思?

I'm looking at the generated code by ASP.NET MVC 1.0, and was wondering; what do the double question marks mean?

// This constructor is not used by the MVC framework but is instead provided for ease
// of unit testing this type. See the comments at the end of this file for more
// information.
public AccountController(IFormsAuthentication formsAuth, IMembershipService service)
{
    FormsAuth = formsAuth ?? new FormsAuthenticationService();
    MembershipService = service ?? new AccountMembershipService();
}

相关:

?空合并运算符—>合并是什么意思?

推荐答案

这是

This is the null-coalescing operator. It will return the value on its left if that value is not null, else the value on the right (even if it is null). They are often chained together ending in a default value.

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆