Andrew Simpson
10/27/2022, 6:32 PMclass Person {
constructor(id: Int, name: String)
constructor(person: Person) : this(person.id, person.name)
}
or would it be “more kotlin-like” to do something like a fun copy() = Person(id, name)
method?Zun
10/27/2022, 11:25 PMAndrew Simpson
10/27/2022, 11:31 PMczuckie
10/27/2022, 11:54 PMfun copy()
but only because I enjoy class Clazz(val fields: Int, val that: Boolean, val go: String, val here: Short)