- Kotlin Programming By Example
- Iyanu Adelekan
- 91字
- 2025-04-04 17:16:16
Boolean
The true and false logical truth values are represented by the Boolean type:
var t: Boolean = true
var f: Boolean = false
Boolean values are operated upon by the &&, ||, and ! logical operators:
Operator name |
Operator |
Description |
Operator type |
Conjunction |
&& |
Evaluates to true when two of its operands are true, otherwise evaluates to false. |
Binary |
Disjunction |
|| |
Evaluates to true when at least one operand is true, otherwise evaluates to false. |
Binary |
Negation |
! |
Inverts the value of its Boolean operand. |
Unary |