Boolean values are values that evaluate to either true or false, and are represented by the boolean data type.

Boolean expressions are very similar to mathematical expressions, but instead of using mathematical operators such as "+" or "-", you use comparative or boolean operators such as "==" or "!".

Boolean operators

The Java boolean operators are based on the operations of the boolean algebra. The boolean operators operate directly on boolean values.

Here is a list of four common boolean operators in Java:

- ! : Boolean NOT
- && : Boolean AND
- || : Boolean inclusive OR
- ^ : Boolean exclusive XOR

The boolean NOT operator ("!") inverts the value of a boolean expression. The boolean AND operator ("&&") will result in true if and only if the values on both sides of the operator are true. The boolean inclusive OR operator ("||") will result in true if either or both of the values on the sides of the operator is true. The boolean exclusive XOR operator ("^") will result in true if one and only one of the values on the sides of the operator is true.

```
boolean True = true;
boolean TrueToo = true;
boolean False = false;
boolean FalseToo = false;
```

Comparative operators

Java has several operators that can be used to compare variables. For example, how would you tell if one variable has a greater value than another? The answer: use the "greater-than" operator.

Here is a list of the comparative operators in Java:

- > : Greater than
- < : Less than
- >= : Greater than or equal to
- <= : Less than or equal to
- == : Equal to
- != : Not equal to

Comparative operators can be used on any primitive types (except boolean), but only the "equals" and "does not equal" operators work on objects. This is because the less-than/greater-than operators cannot be applied to objects, but the equivalency operators can.

`System.out.println(10 > 1); // returns true, because 10 is higher than 1`

`System.out.println(1 == 10); // returns false, because 1 is not equal to 10`