A

Admin • 833K Points
Coach

Q. What is the output of `val a = null ?: "default"`?

  • (A) null
  • (B) a
  • (C) default
  • (D) Error
  • Correct Answer - Option(C)
  • Views: 13
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin

The Elvis operator (?:) returns the right-hand side if the left-hand side is null.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.