14
I’m studying Kotlin. I realized that in converting to the type int
, it is necessary to place the double exclamation (!!
).
Example:
var input = readLine()!!.toInt();
Generally in other languages, double exclamation is used to cast a value for boolean
. However, in this case, it does not seem to be cast, since it is not a boolean operation (as is the case of checking conditions).
So, what’s the point of this double exclamation, which is before toInt
, in Kotlin?
!! Operator
– Marconi