You can also use else if
for additional boolean comparisons. The else
branch (if there is one) will be taken if the if
and all else if
boolean
expressions evaluate to false
.
However, else if
is not very popular in Kotlin -- when
is far more popular
for such structures.
You can learn more about this in:
Tags: