Delegates and observable properties

&#x2F;&#x2F; User.kt import kotlin.properties.Delegates class User { var name: String by Delegates.observable("<no name>") { prop, old, new -> println("$old -> $new") } } fun main() { val user = User() user.name = "first" user.name = "second" } &#x2F;&#x2F; # output: &#x2F;&#x2F; <no name> -> first &#x2F;&#x2F; first -> second Docs: Observable properties Source: 7 Features in Kotlin&#x27;s…