Answers for "check typeof in kotlin"

1

typeof kotlin

val number = 5
if(number is Int) {
   println("number is of type Int")
}

println("${number::class.simpleName}")    // "Int"
println("${number::class.qualifiedName}") // "kotlin.Int"
Posted by: Guest on April-21-2021
0

kotlin check type

// You can use typeof do check data type

fun main() {
    val name = "Kotlin for me"
    println("${name::class.simpleName}")    // "String"

}
Posted by: Guest on April-07-2022

Browse Popular Code Answers by Language