A

Admin • 828.03K Points
Coach

Q. What does `as?` do in Kotlin?

  • (A) Casts to a type unsafely
  • (B) Performs null-safe type casting
  • (C) Converts to string
  • (D) Concatenates strings
  • Correct Answer - Option(B)
  • Views: 4
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin
as? is used for safe casting in Kotlin, returning null if the cast fails.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.