Kotlin: Variable Declarations

According to Kotlin documentation, every variable must be declared.

In Kotlin we have var and val, what’s the difference between these two?

  • var — declares a mutable variable
  • val — declares a read-only or assign-once variable

Ok so let’s try to declare two variables: