lifter
09/06/2018, 7:45 PMy
and z
are defined, or is it really the same thing?
val x: Int? = 0
val y = x!!
val z = x as Int
Shawn
09/06/2018, 7:56 PMShawn
09/06/2018, 7:56 PMx!!
will throw a NullPointerException
if it’s nullShawn
09/06/2018, 7:56 PMx as Int
will throw a ClassCastException
lifter
09/06/2018, 8:03 PMDico
09/06/2018, 8:07 PMkotlin.TypeCastException
.Dico
09/06/2018, 8:07 PMkotlin.KotlinNullPointerException