How to add an item to an ArrayList in Kotlin?
ArrayList
If you want to specifically use java ArrayList then you can do something like this:
fun initList(){ val list: ArrayList = ArrayList() list.add("text") println(list) }
Otherwise @guenhter answer is the one you are looking for.