Kotlin program to get the List equivalent of the given Triple

bookmark

fun main() {
    // creating a new instance of the Triple
    var numbers = Triple(10, 20, 30)

    // Convert to the list using toList()
    val list1: List<Any> = numbers.toList()

    // Print the list
    println("List representation is "+list1.toString())    
}

 


Output:

List representation is [10, 20, 30]