Answers for "creating arraylist in kotlin"

2

arraylist kotlin

fun main(args: Array<String>){  
  
    val arrayList = ArrayList<String>()//Creating an empty arraylist  
    arrayList.add("Ajay")//Adding object in arraylist  
    arrayList.add("Vijay")  
    arrayList.add("Prakash")  
    arrayList.add("Rohan")  
    arrayList.add("Vijay")  
    println(".......print ArrayList.......")  
    for (i in arrayList) {  
        println(i)  
    }  
}
Posted by: Guest on March-03-2021
2

kotlin init arraylist

val list = arrayListOf<Int>()
Posted by: Guest on July-03-2021

Code answers related to "creating arraylist in kotlin"

Browse Popular Code Answers by Language