Null-Coalescing Operator

suggest change


It is a shorthand for the conditional expression:

possibleNullObject != null ? possibleNullObject : defaultValue

The left-side operand (object being tested) must be a nullable value type or reference type, or a compile error will occur.

The ?? operator works for both reference types and value types.

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents