Kotlin - Operators and Expressions
What will be printed by this Kotlin code?
val x: Int? = null val y: Int? = 10 val z = x ?: y ?: 5 println(z)
What will be printed by this Kotlin code?
val x: Int? = null val y: Int? = 10 val z = x ?: y ?: 5 println(z)
x is null, so x ?: y returns y, which is 10.y is not null, y ?: 5 returns 10.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions