Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyKotlinnull safety and double bangSingle-choice MCQ

Both lines compile. Which behaves differently when text is null?

val text: String? = null val a = text?.length // line A val b = text!!.length // line B