I have a interface:
interface SomeInterface<T>{
}
In java i can declare list as follows:
List<SomeInterface> list = new ArrayList<>();
How to write the same in Kotlin? If i try this:
var list = ArrayList<PreferenceSerializer>()
I get an error
Kotlin doesn't have raw types. Since SomeInterface
is generic, you would need to parametrize it. For instance with a wildcard:
var list = ArrayList<SomeInterface<*>>()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With