Kotlin in Action, Second Edition by unknow

Kotlin in Action, Second Edition by unknow

Author:unknow
Language: eng
Format: epub
Publisher: Simon & Schuster
Published: 2024-04-30T22:00:00+00:00


You add two parameters to those functions: one to receive the instance for which the property is get or set (thisRef), and the second to represent the property itself (prop). The property is represented as an object of type KProperty. We’ll look at it in greater detail in chapter 12; for now, all you need to know is that you can access the name of the property as KProperty.name.

You remove the name property from the primary constructor because you can now access the property name through KProperty.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.