Booleans
Learn about boolean type with insights on equality, relational operators, and logical operators.
We'll cover the following...
Another basic type is Boolean
, which has two possible values: true
and false
.
Press + to interact
fun main() {val b1: Boolean = trueprintln(b1) // trueval b2: Boolean = falseprintln(b2) // false}
We use booleans to express yes/no answers, such as:
Is the user an admin? ...