Kotlin Programming By Example
上QQ阅读APP看书,第一时间看更新

Conditional expressions

Conditional expressions are used for branching program flow. They execute or skip program statements based on the outcome of a conditional test. Conditional statements are the decision-making points of a program.

Kotlin has two main structures for handling branching. These are if expressions and when expressions.