C# – Mastering the Basics – Advanced Statements
In todays episode, I’ll show you how to use three advanced statements in C#. I’ll go over the so-called null-conditional operator, the null-coalescing operator and the ternary operator. Null-Conditional Operator You can use the null-conditional operator to prevent _NullReferenceException_s. The basic principle of the operator is to return a value if it is not null, and return null if it is. The following code shows you how to use the operator, which is initiated by a question mark, followed by a dot. ...