Beginner Kotlin
Q31 / 100

How does Kotlin handle null safety compared to Java?

Correct! Well done.

Incorrect.

The correct answer is B) Kotlin types are non-nullable by default; null must be explicitly opted into with ?

B

Correct Answer

Kotlin types are non-nullable by default; null must be explicitly opted into with ?

Explanation

Kotlin's type system distinguishes nullable (String?) from non-nullable (String) at compile time, catching most NullPointerExceptions before runtime.

Progress
31/100