I just started using Kotlin and found getters and setters very useful.
I am wondering if Kotlin provides only getters public.
It should not be val
because it's value can be changed by it's class.
What I've done to achieve this is as follows.
private var _score: Int=0
val score: Int = _score
get() = _score
Using this way, I have to declare two variables.
Is there any better way to only make getters public?