Kotlin Elvis operator
What does this Kotlin code print when user is null?
val user: User? = null val name = user?.name ?: "Guest" println(name)
Discussion 0
Join free to post in the discussion.
Related questions
- Kotlin val with a mutable listMobile App Developer
- Kotlin data class equalityMobile App Developer
- Dart null-aware operatorsMobile App Developer
- lateinit or by lazyMobile App Developer
- A chain of safe callsMobile App Developer
- What !! does on nullMobile App Developer
- What let returnsMobile App Developer
- Configuring an object with applyMobile App Developer