📜  kotlin var 和 val - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32.742000             🧑  作者: Mango

代码示例3
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.