Kotlin theorytheory 0/50 · 0%
Fundamentals · easy

3. Val vs Var

Read-only vs Mutable variables.

Use 'val' for read-only (immutable) variables and 'var' for mutable variables.

Check your understanding

  1. 1. Which can be reassigned?

  2. 2. Which is preferred for safety?