All together

Report a typo

What is the output of this snippet?

fun main() {
    val age: Int? = null
    val name: String? = "Bob"
    val nickname: String? = null
    val length: Int = nickname?.length ?: 0
    println("$age ${name?.length} $length")
}
Enter a short text
___

Create a free account to access the full topic