Kotlin language is mostly used with Android studio to create native Android apps. I don’t know other use of this language BTW, of course it could be useful in some other fields too.
Var vs Val
There are two ways to define a variable in this language which are var and val
- Var -> when we define a variable using var keyword in this language, that variable’s value can be modified. It is similar to let in the JavaScript language
- Val -> when we define a variable using val keyword its value cannot be modified later. It is similar to const in the JavaScript language.
Leave a Reply