Answers for "int to long in kotlin"

1

kotlin Number to Long

val something: Any = getSomething()
if(something is Number) {
    val longValue = something.toLong()
}
Posted by: Guest on February-20-2021
0

how to type cast INT to Long in Kotlin

// Kotlin Int to Kotlin Long 
val a : Int = 1
val b : Long = a.toLong()
Posted by: Guest on January-15-2022

Browse Popular Code Answers by Language