Generics in Kotlin: Covariance and Contravariance

preview_player
Показать описание
This week, Amanda covers types, classes, and generics in Kotlin.

Are you interested in contributing? Contact us or head over to Github to get started!
Рекомендации по теме
Комментарии
Автор

after watching several times i only understood that when we use 'out T' then we can only use T as return type and when we use 'in T' the we can use T only for input parameter in a class

mkc
Автор

One thing I don't get is why we would need different keywords for the covariance/ contravariance. Both are essentially saying "use a type that is a subtype of the provided value". Why do I care if the value is consumed or produced? The covariance part is very clear, but contravariance confuses me. It surely doesn't mean "any class that is a super class of the provided argument", is it? Because that doesn't make much sense to me. Questions aside, the content was very good and you're fun to listen to. Keep up the good work!

mihaifumarel
Автор

This is both humorous and informative. Sloths and Pandas FTW !

NicksonKaigi
Автор

I don't know, I still don't understand what covariance or contravariance means and when to use which keyword.

pcfreak
Автор

Still don't get it lol, don't think it's an issue with the instructor though, she clearly knows what she's talking about, but the whole concept itself just isn't easy to grasp, maybe it'll get better as I use Kotlin more and more, and this video definitely helped in giving me an initial idea even though I still don't feel like I got it 100% so much appreciated!

mhdunknown
Автор

Really great and helpful video..really needed topic, thanks!
I Subbed, make more

iftak
Автор

Amazing voice nice to listen. But I still don't understand what contravariance is.

skotch_izolentovich
Автор

Good video, would help visibility if project panel wasn't taking up 1/3 of screen tho.

wavecycle
Автор

But you didn’t use the keyword out or in anywhere? What you did has nothing to do with covariance or contra-variance. You just referred the objects of subclasses with the reference of the super class.

asadullahilyas
Автор

great explanation. got a bit complex at the end, so may require a few more views. thank you

kyletycholiz
Автор

Yo, that intro beat would make for a 🔥 hip hop track

SimBol
Автор

whats the music in the end, and it is your phone ringtone too.

vikaspandey
Автор

Can anyone please send me the name of the song if you know.

davorstajcer
Автор

For a video that's supposed to be about covariance and contravariance, this doesn't explain much. The examples are pleasant though.

huttarl
Автор

Was watching in full screen, i thought my laptop was about to shutdown due to low battery @1:46

syednoorullahshah
Автор

this is really bad explanation, especially Contravariance part...

БейбутТукибаев-сь
Автор

If I didn't know about covariance/contrvariance I wouldn't understand nothing of this explanation 😀 Ends like "Oh, I have an incomiming call, have nice day"

yourpapa