kotlin and java code example
Example 1: Kotlin is like java
// if is an expression, so ternary operation not needed
val loaded = true
val status = if (loaded) "Ready" else "Loading..."
// "Ready
Example 2: Kotlin is like java
var myVariable = 42
myVariable = 50
val myConstant = 42