The ?? operator is used between two operands where the first operand must be a nullable type. The second operand must be of the same type as the first operand or of the type that can be implicitly converted to the first type. It checks whether the value of the first operand is null or not. If the value of the first operand is null, it returns the value of the second operand.

In case, if you declare the second operand to the type that cannot be implicitly converted to the type of the first operand, a compile-time error is generated.

Let’s take one example to understand the concept of ?? operator more clearly.