Beginner Kotlin
Q37 / 100

What is the difference between var and val?

Correct! Well done.

Incorrect.

The correct answer is C) var is mutable (can be reassigned); val is read-only

C

Correct Answer

var is mutable (can be reassigned); val is read-only

Explanation

var allows reassignment; val doesn't. Note that val only prevents reference reassignment — a mutable object held by val can still be mutated.

Progress
37/100