Kotlin - Basics and JVM Runtime
Identify the error in this Kotlin code:
fun main() {
val number = 10
number = 20
println(number)
}fun main() {
val number = 10
number = 20
println(number)
}val declares a read-only variable that cannot be reassigned.number after declaring it as val, causing an error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions