I’m new to Kotlin. Why does Kotlin not provide the val modifier for function parameter, like final in Java and const in C++?
fun method(val param: String) = …
I’m new to Kotlin. Why does Kotlin not provide the val modifier for function parameter, like final in Java and const in C++?
fun method(val param: String) = …
Function parameters are read-only inside the function in Kotlin, so there is no need to specify modifier as it is always val
.