A

Admin • 833K Points
Coach

Q. What is the correct syntax to define a nullable string?

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

Explanation by: Admin

String? indicates that the variable can be null.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.