Ellen Spertus
06/02/2022, 8:55 PMRuckus
06/02/2022, 9:01 PMCameron Mallory
06/02/2022, 9:02 PMdata class Name(val first: String, val last: String){
fun getFullName(): String =
"$first $last"
}
If we run that in a Kotlin scratch file in Android Studio we get:Cameron Mallory
06/02/2022, 9:02 PMRuckus
06/02/2022, 9:03 PMEllen Spertus
06/02/2022, 9:04 PMCameron Mallory
06/02/2022, 9:05 PMCameron Mallory
06/02/2022, 9:09 PMCameron Mallory
06/02/2022, 9:11 PMEllen Spertus
06/02/2022, 9:11 PMEllen Spertus
06/02/2022, 9:12 PMCameron Mallory
06/02/2022, 9:13 PMEllen Spertus
06/02/2022, 9:15 PMCameron Mallory
06/02/2022, 9:18 PMFooExts.kt
file that all extensions can go into for easy discoverability IF we think they’d be useful “globally”. Otherwise private extensions in the same file where it’s used works for us.Matteo Mirk
07/04/2022, 3:30 PMRuckus
07/05/2022, 6:33 PMIf the extensions are defined in the same file, then what’s the point of using them?This article gives a good explanation as to the point.
Matteo Mirk
07/06/2022, 2:19 PM