If I know a value is null initially but won’t be n...
# getting-started
v
If I know a value is null initially but won’t be null when accessed. Is it preferred to
!!
?.
s
It’s better to use
?.
as this construct does exactly what it should - helps to avoid unexpected NPE.
i
You can declare it as
lateinit var
with non-nullable type.
9