A

Admin • 828.03K Points
Coach

Q. How do you declare a nullable variable of type String?

  • (A) val name: String
  • (B) val name: String?
  • (C) String name = null
  • (D) nullable String name
  • Correct Answer - Option(B)
  • Views: 8
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin
The '?' allows a variable to hold a null value in Kotlin.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.