1.

What’s the difference between lazy and lateinit?

Answer»
LateinitLazy
It is LATE initializationIt is lazy initialization.
It can be INITIALIZED from anywhere in the objectIt can be initialized only from the lambda function.
It can only be used for var type.It can only be used for Val type.
Multiple INITIALIZATIONS are possible in lateinit.Only a SINGLE initialization is allowed here.
It is not allowed in PROPERTIES of primitive types.It is allowed on properties of primitive types.


Discussion

No Comment Found