Kotlin If..Else..Else If decision makingKotlin supports below decision making statements:
- “If” statements: where if a condition is true it is used to specify execution for a block of code.
- “Else” statements: where if the same condition is false it specifies the execution for a block of code.
- “Else if” statements: this specifies a new test if the first condition is false.
Syntax of If statement
Example of if, Else, Else if in Kotlin
In this page (written and validated by A. Gawali) you learned about Kotlin If..Else..Else If decision making . What's Next? If you are interested in completing Kotlin tutorial, your next topic will be learning about: Kotlin Switch Statement When equivalent.
Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: firstname.lastname@example.org.