lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 15
What is the output of the following code snippet?
bool? a = null; Console.WriteLine(a ?? true);
A. True
B. False
The null-coalescing operator (??)
The null-coalescing operator has the following form: first_operand ?? second_operand; The operator returns the first_operand if it is not null; otherwise, it returns the second_operand.
Links:
The Null-coalescing Operator
Nullable Types
Using Nullable Types
Boolean Data Type