Lateinit and lazy initialization in kotlin. Difference between lateinit & lazy. #kotlin 6 program.

preview_player
Показать описание
Lateinit and lazy initialization in kotlin. Difference between lateinit & lazy. #kotlin 6 program.
1) lateinit property
lateinit property means late initialization initialize in future.
They are var properties that can be initialized later.
It cannot use with primitive data types like int or long etc
We have to sure before use that variable it will initialized otherwise
It will through an exception may app crash

2) lazy property
lazy property means layz initialization
They are val properties that can not initalize again and again.
It can use with premitive data types.
It can assign value when variable first time called otherwise not

My channel link subscribe to my channel

that's it from today hope you understand this video

please suggest if you want a video in any topic in comment below

Thanks
Рекомендации по теме
join shbcf.ru