Explain the difference between Val and Var in kotlin?
1 answers to this question.
- Both Val and Var in kotlin are utilized to declare a variable, Var is a general variable, and we can assign Var the various number of times and Var also acknowledged as the mutable variable.
- Val is acknowledged as an immutable variable because it is constant and we cannot assign it a various number of times.
If you want to learn more about this amazing language, Enroll Now: Kotlin Training