val declares a read‑only reference you can’t reassign after initialization. var declares a mutable reference that can be reassigned. val doesn’t make the object itself immutable, but it encourages safer code.
Advanced answer
Deep dive
Expanding on the short answer — what usually matters in practice:
Context (tags): kotlin, variables, immutability
JVM: memory (heap/stack), GC, and what drives latency.
Contracts: equals/hashCode/toString, mutability and consequences.