'by lazy' and 'lateinit'
2021-12-05 本文已影响0人
Jegsavnerdeg
In Kotlin, if you don't want to initialize a class property inside the constructor or in the top of the class body, you have basically these two options (from the language reference):
https://agrawalsuneet.github.io/blogs/lateinit-vs-lazy-property-in-kotlin/