3.1 Boolean Expressions
Section 1 of 6
Boolean expressions are like simple “yes or no” questions that a computer can answer. When you compare two values (e.g., Is 5 greater than 3?), the result is always either true or false. This true-or-false logic is how your computer decides which instructions to execute next: if the condition is true, it follows one path; if it’s false, it follows another. There are quite a few symbols that can be used to form boolean expressions. The first one is the == (equal-to) operator, which tests whether the expression on the left is equal to the expression on the right.
java
Output
true false true

Nova

Ask Nova a question!