January 2018
Intermediate to advanced
434 pages
14h 1m
English
Let's follow the given steps to understand how the lateinit modifier works:
var student:Student?=null
Alternatively, you can do this:
val student=Student()
Both ways have their drawbacks. The first way will require you to check nullability whenever you use it, and the second way of initializing will make it immutable.
Read now
Unlock full access