Question from the Kotlin test

Print the value of a nullable string in Kotlin

Easy
var chaine : String? = null
chaine?.let { println("string is $chaine") } ?: run { println("string was null. Setting the value to:")
    chaine = "Kotlin"}
println(chaine)

What does the console show?

Author: W3D TeamStatus: PublishedQuestion passed 518 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!