Open WhoisAbel opened 2 years ago
Property delegation in Kotlin helps you to handoff the getter-setter responsibility to a different class.
This class (called delegate class) provides getter and setter functions of the property and handles its changes.
A delegate property is defined using the by clause and a delegate class instance:
// Syntax for property delegation var <property-name> : <property-type> by <delegate-class>()
Property delegation in Kotlin helps you to handoff the getter-setter responsibility to a different class.
This class (called delegate class) provides getter and setter functions of the property and handles its changes.
A delegate property is defined using the by clause and a delegate class instance: