Respuestas de varianza: si Perro es un subtipo de Animal, ¿Lista<Perro> es un subtipo de Lista<Animal>? En Kotlin, los tipos genéricos son invariantes de forma predeterminada: List<Dog> no es List<Animal> por seguridad de mutabilidad. Utilice out (covariante) cuando solo produzca T: solo lectura. Úselo en (contravariante) cuando solo consuma T, como Comparator<Animal> que acepta Comparator<Dog>.

fuera - productores
Full content is available with a subscription.
Get full access to all courses on the platform for one year with a single payment.
Unlike other platforms that charge per course, here you get everything for one price, and after one year of use there will be no automatic charge for the following year.