The example is from a Kotlin-course I'm doing:
class Car {
var speed: Int = 0
get() = field
set(value) {
field = value
}
}
If I like to use a primary constructor like this:
class Car(var speed: Int)
How would I have to write the getter / setter in that case?