Kotlin - Variables and Type System
What is the main difference between
var and val in Kotlin?var and val in Kotlin?var and val usagevar declares a mutable variable, meaning its value can change after initialization. val declares an immutable variable, which cannot be reassigned once set.var allows reassignment and val does not, the main difference is mutability.var allows variable reassignment, val does not -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions