A

Admin • 833K Points
Coach

Q. What will happen if you try to assign null to a non-nullable type in Kotlin?

  • (A) It compiles and runs
  • (B) It throws a warning
  • (C) It results in a compile-time error
  • (D) It skips the assignment
  • Correct Answer - Option(C)
  • Views: 13
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin

Kotlin ensures null safety and will not allow assigning null to non-nullable types.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.