Notes
A boolean type in Apex is declared with the boolean keyword and can only take the values true or false:
boolean isPrime = true;
System.debug(isPrime );
Output: true
A Boolean expression is an expression that returns a Boolean value: true or false.
Integer x = 12;
Integer y = 12;
System.debug(x == y);
or
System.debug(12 == 12);
Output: true
System.debug(2 > 1);
Note: The above code returns true because 2 is greater than 1.
System.debug(1 < 0);
Note: The above code returns false because 1 is not less than 0.