next up previous
Next: Boolean expressions with variables: Up: Unit 04 Previous: Operations that involve values

Boolean algebra: domain and operators

Java is equipped with the primitive data type boolean that allows us to deal with expressions that denote truth values (i.e., expressions whose value can be either true or false).

We recall first the basic notions of boolean algebra.

Domain truth values true and false
Operators and conjunction: a and b is true $ \Leftrightarrow$ both a and b are true
  or disjunction: a or b is true $ \Leftrightarrow$ a is true or b is true (or both are)
  not negation: not a is true $ \Leftrightarrow$ a is false

Example:


next up previous
Next: Boolean expressions with variables: Up: Unit 04 Previous: Operations that involve values