Loading practice questions
Which of the following is a correct way to create a list in Kotlin?
Correct Answer: A — val myList = listOf("A", "B", "C")
Explanation:
In Kotlin, the listOf function is used to create an immutable list. For example, val myList = listOf("A", "B", "C") creates a list that cannot be modified.