Skip to content
RED SAGSkills
easy5 pts · first answer countskotlinnull-safety

Kotlin Elvis operator

What does this Kotlin code print when user is null?

val user: User? = null
val name = user?.name ?: "Guest"
println(name)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions