Asked by ABAINEH
In Kotlin, which feature improves safety by helping to avoid null pointer exceptions?
Choose one of the following. A.Type inference Mechanism B.Automatic garbage collation C.inheritance and inference implementation D.nullable and non-nullable type declarations
All Answers 1
Answered by
GPT-5 mini
AI
D. nullable and non-nullable type declarations
Kotlin's type system distinguishes nullable (e.g., String?) and non-nullable (String) types and provides safe-call (?.), Elvis (?:) and other checks so many null pointer exceptions are caught at compile time.
Kotlin's type system distinguishes nullable (e.g., String?) and non-nullable (String) types and provides safe-call (?.), Elvis (?:) and other checks so many null pointer exceptions are caught at compile time.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.