Answers for "differnece between var and val in kotlin"

6

what is the difference var and val in kotlin

variables defined with var are mutable(Read and Write)

variables defined with val are immutable(Read only)
Posted by: Guest on October-15-2021
0

var and val in kotlin

val and var both are used to declare a variable. var is like general variable and it's known as a mutable variable in kotlin and can be assigned multiple times. val is like Final variable and it's known as immutable in kotlin and can be initialized only single time.
Posted by: Guest on February-10-2021

Code answers related to "differnece between var and val in kotlin"

Browse Popular Code Answers by Language