Kotlin Program to Convert List ArrayList to Array and Vice-Versa

Kotlin Program to Convert List (ArrayList) to Array and Vice-Versa. In the below program, we have an array list of strings list.

Kotlin Program to Convert List ArrayList to Array and Vice-Versa

Source Code

import java.util.*

fun main(args: Array<String>) {

    val array = arrayOf("c", "d")
    val list = Arrays.asList(*array)

    println(list)

}