I am trying to learn Kotlin. What is val, var and internal in Kotlin compared to Java?
val
var
internal
In Java:
RadioGroup radio
In kotlin we can declare variable in two types: val and var. val cannot be reassigned, it works as a final variable.
val x = 2 x=3 // cannot be reassigned
On the other side, var can be reassigned it is mutable
var x = 2 x=3 // can be reassigned