https://kotlinlang.org logo
Title
u

user

06/21/2022, 9:51 AM
create objects based on elements of a list Suppose I have the below lists and data classes in Kotlin: val qrtr = listOf("Q1", "Q2", "Q3", "Q4") data class X(val name: String, val location: String) val x1 = X("John Doe", "USA") val x2 = X("Jane Doe", "Singapore") val allX = listOf(x1, x2) data class Y(val title: String, val rating: Double) val y1 = Y("Senior", 4.8) val y2 = Y("Junior", 4.5) val allY = listOf(y1, y2) Is there an easy way to create another list using a 3rd data class using the above lists of allX, allY and qrtr. data...