Understanding Boolean Logic
Boolean logic is a special type of arithmetic/comparison that is used to evaluate expressions down to either true or false. This may be a new concept to you, but don't worry; it's not difficult to understand. Boolean logic is performed using a logical operator. Consider the following sentence:
If black is a color and wood comes from trees, then print “ice cream.”
At first glance, it might seem that this is nonsensical. However, Visual C# .NET could make sense of this statement using Boolean logic. First, notice that three expressions are actually being evaluated within this single sentence. I've added parentheses in the following sentence to clarify two of the expressions.
If (black is a color) and (wood comes from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access