Covariance allows you to use a subtype in place of a supertype. In Kotlin generics, it is denoted by the out keyword.
List<out T> is covariant. A List<String> IS A List<Any>.val strings: List<String> = listOf("A", "B")
val objects: List<Any> = strings // Valid because List is covariant (out T)
in.Comparable<in T>. A Comparable<Any> can compare Strings.Mark this when you can explain the answer in your own words.
Help fellow developers prepare for interviews
Sharing helps the Android community grow ๐