![]() ![]() In Kotlin since people have access to `lateinit` modifier, they tend to initialize global variables□ using it, so they don't have to start off with a nullable type variable and don't have to do null handling every time they access the value of the object. So as a common practice by Java developer used to initialize global variables as null. If we see this how it is related to nullable handling is because developers keep global variables □ whose value is assigned later in the flow. So the basic gist of using lateinit modifier is to tell the compiler that this variable would be initalized late □, It will not allocate memory until initialized. ![]()
0 Comments
Leave a Reply. |