1) Implement getter with logic
# android
j
1) Implement getter with logic
m
Why not just this?
Copy code
data class User(val firstName: String, val lastName: String) {
    val fullName = "$firstName $lastName"
}
👍 1
☝️ 1
a
I'm going to be that annoying I18N guy: some cultures put the last name first. For that reason too,
givenName
and
surname
are better property names.
👍 1
j
haha, that's only an example, but thanks @Alan Evans Valid point!
😁 1