What is correct way to create an arraylist in Kotlin?

Q & AWhat is correct way to create an arraylist in Kotlin?
Admin Staff asked 4 years ago

What is correct way to create an arraylist in Kotlin?

a)val map = hashMapOf(1 to “one”, 2 to “two”, 3 to “three”)
b)enum class Color {RED, GREEN, BLUE}
c)val list = arrayListOf(1, 2, 3)
d)val set = hashSetOf(1, 2, 3)

1 Answers
Admin Staff answered 4 years ago

c)val list = arrayListOf(1, 2, 3)