What is the correct way to define a var in kotlin that has a public getter and private (only internally modifiable) setter?
You can easily do it using the following approach:
var atmosphericPressure: Double = 760.0 get() = field private set(value) { field = value }
Look at this story on Medium: Property, Getter and Setter in Kotlin.