Any suggestions about how to make this code compilable?
interface I1 {
val id: String
}
interface I2 {
val id: Integer
}
class Test: I1, I2 {
//???
}
Any suggestions about how to make this code compilable?
interface I1 {
val id: String
}
interface I2 {
val id: Integer
}
class Test: I1, I2 {
//???
}
I guess you can do this by generics.
class Test<T>{
val id: T? = null
}
And you can call this by
val test = Test<String>().id
val test01 = Test<Int>().id