August 2018
Beginner
178 pages
4h 56m
English
Kotlin’s if-else statements are expressions, not keywords. Which means they can have a value. Consider this example where an if-else expression is used to initialize a variable:
val str: String = if (num < 10) "Lower than 10" else "Equal or greater than 10"
Read now
Unlock full access