Jrichards1408
11/26/2020, 2:49 PMTim VanFosson
11/26/2020, 2:54 PMJrichards1408
11/26/2020, 2:57 PMval (name, age) = person
the above does not make sense.?
It states that it is converted to:
val name = person.component1()
val age = person.component2()
Jrichards1408
11/26/2020, 2:58 PMAnimesh Sahu
11/26/2020, 2:58 PMAnimesh Sahu
11/26/2020, 2:59 PMfun <T> List<T>.component6() = get(5) // or this[5]
Jrichards1408
11/26/2020, 3:00 PMPerson
data class like this:
data class Person(val name: String, val age: Int)
Component1() = name of type string and component2() = age of type Int?Animesh Sahu
11/26/2020, 3:00 PMInt?
but Int
.Jrichards1408
11/26/2020, 3:01 PMJrichards1408
11/26/2020, 3:01 PMTim VanFosson
11/26/2020, 3:01 PMTim VanFosson
11/26/2020, 3:01 PM`componentN()` functions corresponding to the properties in their order of declaration;
Animesh Sahu
11/26/2020, 3:01 PMJrichards1408
11/26/2020, 3:02 PM