Using bool?
variables, can somebody explain why true & null
results in null
and false & null
results in false
?
void Main()
{
bool? a = null;
bool? b = true;
bool? c = a & b;
Console.WriteLine($"{b} & NULL => " + c);
b = false;
c = a & b;
Console.WriteLine($"{b} & NULL => " + c);
}
Output:
True & NULL =>
False & NULL => False
I would also be happy about the duplicate, because I did not find it, yet.