Reputation: 31
I’m searching for an explanation of how to write an interface with the generic type T extending two interfaces Comparable and Serializable
Interface<K:Comparable<K>>
It should also be K: java.io.Serializable
I want to know if it is possible in Kotlin programming language
Upvotes: 0
Views: 152
Reputation: 2046
interface MyInterface<K> where K : Comparable<K>, K : Serializable
Please see https://kotlinlang.org/docs/tutorials/kotlin-for-py/generics.html#constraints for details.
Upvotes: 1