https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

rustyrazorblade

02/03/2023, 9:59 PM
I’ve got a class that has a handful of fields with the same type. is it possible to have a function that takes a reference to the field, does some computation then assigns the result to the field?
Copy code
fun assignGeneric(ref: ??, value String) {
  // do stuff with value
  ref = value
}
k

Kirill Grouchnikov

02/03/2023, 10:04 PM
4 Views