Skip to content

MediumConceptKotlin language

What is the difference between lateinit and lazy in Kotlin?

What a good answer covers

lateinit defers initialisation of a non-null var that you assign later and throws if read too early. lazy initialises a val on first access and caches the value.

More on Kotlin language

Flashcards for this topic