Link to lesson

Booleans

Either true or false.

Operations are the same as in any other programming language with things like >, ==, etc.

Just as in most other languages, you have standard control flow (if, else if, else)

Vocab

Relational Operators compare two values (==, >, !=, etc)

  • Do note that for reference types you must use .equalTo() and .compareTo()

Compound Boolean Expressions have multiple conditions joined together (using things like &&, ||, and !)

De Morgan’s Law

!(a && b) can be simplified to !a || !b

!(a || b) can be simplified to !a && !b

Boolean Logic Visualizer

A

false

B

false
A B A AND B A OR B A XOR B NOT A
false false false false false true
false true false true true true
true false false true true false
true true true true false false