Kotlin - Null Safety
What will be the output of this Kotlin code?
val name: String? = null val displayName = name ?: "Guest" println(displayName)
val name: String? = null val displayName = name ?: "Guest" println(displayName)
namename is explicitly set to null.name is null, displayName gets the default value "Guest".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions