KotlinSyntax
Create a List
Code example
val nums = listOf(1, 2, 3)
val items = mutableListOf<String>()Creates read-only or mutable lists.
In Kotlin, create a list: creates read-only or mutable lists — val nums = listOf(1, 2, 3) val items = mutableListOf<String>()
val nums = listOf(1, 2, 3)
val items = mutableListOf<String>()val nums = listOf(1, 2, 3)
val items = mutableListOf<String>()Creates read-only or mutable lists.
Use val nums = listOf(1, 2, 3) val items = mutableListOf<String>().
Use this pattern: val nums = listOf(1, 2, 3) val items = mutableListOf<String>()
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.