Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyKotlinelvis operatorSingle-choice MCQ

Does the right side of the Elvis operator get evaluated when the left side is non-null?

fun loadDefault(): String { println("loading") return "fallback" } val value: String? = "hello" val r = value ?: loadDefault()