Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinplatform types mechanicsSingle-choice MCQ

Why can a Kotlin platform type sometimes let provably-null values flow without an immediate exception, unlike a declared non-null type? Pick the accurate mechanism.

// Java: <T> T first(List<T> xs) { return xs.get(0); } // Kotlin: val xs = listOf<String?>(null) val s = javaUtil.first(xs) // type inferred as String! (platform) println(s.length) // ?