What is the correct way to define a var in kotlin that has a public getter and private (only internally modifiable) setter?
var name : String = "Peter" private set
By default all properties and functions are public in Kotlin. Hence the setter has to be explicitly declared private while the getter is public by default.