Kotlin - Variables and Type System
What will be the output of this Kotlin code?
val x = 10 // x = 20 println(x)
val x = 10 // x = 20 println(x)
x is declared with val, so it is immutable and cannot be reassigned.x = 20 is commented out, so it does not run. The value of x remains 10.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions