Kotlin when expression is similar to the switch statement in C, C++ and Java. Kotlin when can be used either as an expression or as a statement, simply like a switch statement in Java. If it is used as an expression, the value of the first matching branch becomes the value of the overall expression.
kotlin programming coding vaibhav kotlin-programming vaibhavmojidra vaibhav-mojidra mojidra kotlin-when
- Updated
May 1, 2023 - Kotlin