In Kotlin, val and var are the two keywords you can use to declare variables.
val
var
val is using for Read-Only local variables definition. Means immutable, you can assign only once, which is same as final in Java.
final
I decide to start to write some small and quick code pills to help to understand how Kotlin works.
As you know, Kotlin works on JVM and most of developers are friendly with Java, that’s why I will use Java to help to show concept of Kotlin.