Kotlin - Null Safety
What will be printed by the following Kotlin code?
val message: String? = null println(message?.toUpperCase() ?: "Empty")
val message: String? = null println(message?.toUpperCase() ?: "Empty")
toUpperCase() only if message is not null.message is null, the Elvis operator (?:) returns "Empty".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions