?? Null Coalescing Operator --> What does coalescing mean?

前端 未结 7 2030
情歌与酒
情歌与酒 2020-12-01 20:16

I\'m tempted to lie and say that English is my second language, but the truth is that I just have no idea what \'Coalescing\' means. I know what ?? \'does\' in

7条回答
  •  情书的邮戳
    2020-12-01 21:01

    Coalescing word derives from Latin language, and means "to join together" something. In particular it designates in physical chemistry, a phenomenon in which small drops of a liquid dispersed in another immiscible liquid tend to join the larger ones, forming larger aggregates; this is called "Coalescence".

    In C# context, for extension, this "join" happens between variables thanks to the null coalescing operator, but the resulting value depends from the fact that the first operand is null or not, if it is, then the reulting value will be that of the second operand.

提交回复
热议问题