- Kotlin Programming By Example
- Iyanu Adelekan
- 110字
- 2025-04-04 17:16:16
Controlling program flow
When writing programs, a scenario that often occurs is one in which we want to control how our program executes. This is necessary if we want to write programs that can make decisions based on conditions and program state. Kotlin possesses a number of structures for doing this, which will be familiar to people who have worked with programming languages in the past, such as if, while, and for constructs. There are also others that may not be familiar to individuals, such as the when construct. In this section, we will take a look at the structures at our disposal for controlling the flow of our program.