Kotlin 2 · Classes and types
Compute a value on first use
lazy runs its block once, the first time the property is read.
val config by lazy { loadConfig() }
Official Kotlin 2 documentation
Kotlin 2 · Classes and types
lazy runs its block once, the first time the property is read.
val config by lazy { loadConfig() }
Official Kotlin 2 documentation
Was this page helpful?