I'm studying Kotlin. I noticed that, in the conversion to type int
, it is necessary to put the double exclamation ( !!
).
Example:
var input = readLine()!!.toInt();
Generally in other languages double exclamation is used to cast a value to boolean
. But in this case, it does not seem to be cast, since it is not a Boolean operation (as is the case with condition checking).
So, what is the use of this double exclamation, which is before toInt
, in Kotlin?