A lesson by Akshay Chordiya
In Kotlin we need to initialize a variable or mark it as
null which is not mostly convenient because then we need to add null checks every time we use the variable.
lateinit modifier comes in, it gives guarantee to the compiler that the variable will be initialized at the later stage and tells compiler to relax on Null Safety.
In this lesson you will learn:
- How to use
- Verify the behavior of
- Check what happens if lateinit variable is not initialized at later stage