In this article, we will learn about how to use Java Ternary Conditional Operator in Kotlin.
In Kotlin, if statements are expressions. So the following code is equivalent.
if (a) b else c
If you’re coming from a language where this is a statement it might sound unnatural, but that feeling should wear off soon.