Assign if not null operator

后端 未结 0 1292
北恋
北恋 2021-02-01 06:01

Is there a shortcut to the following statement?

if(b!=null) a=b;

The best I can come up with is

a=b??a;

I want to

相关标签:
回答
  • 消灭零回复
提交回复
热议问题