How to initialize an empty array list in Kotlin? [duplicate]
Solution 1:
According to the api-doc:
val list = arrayListOf<Int>()
This is also mentioned here: How to initialize List in Kotlin? .
Solution 2:
I suggest you write
var myList: ArrayList<Int> = arrayListOf()