In Kotlin, var and val are used to declare variables. The main difference between them is that var declares a mutable variable, which means its value can be changed after it is initialized, while val declares an immutable variable, which means its value cannot be changed after it is initialized.
vaibhavmojidra / kotlin---demo-difference-between-var-and-val Goto Github PK
View Code? Open in Web Editor NEWIn Kotlin, var and val are used to declare variables. The main difference between them is that var declares a mutable variable, which means its value can be changed after it is initialized, while val declares an immutable variable, which means its value cannot be changed after it is initialized.
Home Page: https://vaibhavmojidra.github.io/site/
License: MIT License