Why Do We Need Covariance and Contravariance? | Explained by AI

preview_player
Показать описание
Did you ever wonder why do covariance and contravariance exist in C#?
In this video, we will try to write some code as if variance never existed, only to discover the limit beyond which the code will cease to compile anymore!
This video will outline the problems the C# compiler must solve when it encounters assignments incorporating more than one type, such as in generic types. Watch it as a starting point in learning about covariance and contravariance, one of the most striking features of the entire C# programming language!

#dotnet #csharp #ai
Рекомендации по теме