Kotlin Notes Help

Booleans

The type Boolean represents boolean objects that can have two values: true and false.

Boolean has a nullable counterpart declared as Boolean?.

Built-in operations on booleans include:

  • || – disjunction (logical OR)

  • && – conjunction (logical AND)

  • ! – negation (logical NOT)

The || and && operators work lazily, which means:

  • If the first operand is true, the || operator does not evaluate the second operand.

  • If the first operand is false, the && operator does not evaluate the second operand.

Last modified: 15 February 2024