how to make getter setter in kotlin
snippet in kotlin

how to make getter setter in kotlin

user5029

class Company {
    var name: String = "defaultvalue"
        get() = field                     // getter
        set(value) { field = value }      // setter
}