C# Language Highlights: Null Coalescing Operator

preview_player
Показать описание


?? and ??= operators (C# reference)

First steps with C#

#DotNet #csharp
Рекомендации по теме
Комментарии
Автор

IN the first case I would say the question is "if the condition is true" but not "if it is null", It could be confusing because we are not here evaluating if it is null but just evaluating a condition.

Lonchanick
Автор

What if I want to print anything else other then 5. How can I do it with null coealsing ?

riturajjana
Автор

Does C# allows the creation of new operators unlike C++ ?

larknoone
Автор

Actually, thank goodness for conditional operators, coalescence, and nullable reference types. If it didn't exist, your code would be if if if if if if if if switch if if 😂

chefbennyj