After supporting the modified Kotlin M5.1 settings , in earlier versions that can be achieved with
fun foo(var x: Int) {
x = 5
}
According to Kotlin developers, the main reasons for removing this feature below are
. val. . -
fun say(val msg: String) {
var tempMsg = msg
if(yourConditionSatisfy) {
tempMsg = "Hello To Me"
}
}