Skip to content
Justice Tech School

Kotlin Booleans

Boolean has two values, true and false. Comparisons produce booleans, and && || ! combine them. && and || stop early.

Example
val age = 20
val adult = age >= 18
println(adult)
println(adult && age < 65)
println(!adult)

Exercise

Negate a value.

adult

Quiz Test

Which operator is logical not?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.