A

Admin • 802.91K Points
Coach

Q. Which of the following is a correct way to create a list in Kotlin?

  • (A) val list = List(1, 2, 3)
  • (B) val list = [1, 2, 3]
  • (C) val list = listOf(1, 2, 3)
  • (D) val list = makeList(1, 2, 3)
  • Correct Answer - Option(C)
  • Views: 2
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin
The function listOf() is used to create immutable lists in Kotlin.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.