paint-brush
The Difference Between Covariance and Contravariance in .NET C#by@ahmedtarekhasan
2,689 reads
2,689 reads

The Difference Between Covariance and Contravariance in .NET C#

by Ahmed Tarek Hasan12mJanuary 3rd, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Covariance and Contravariance were introduced by Microsoft in C# 6.0. They allow implicit reference conversion for array types, delegate types, and generic type arguments. Covariance preserves assignment compatibility and contravariance reverses it. Microsoft’s definition is different from what you would find in this story.
featured image - The Difference Between Covariance and Contravariance in .NET C#
Ahmed Tarek Hasan HackerNoon profile picture
Ahmed Tarek Hasan

Ahmed Tarek Hasan

@ahmedtarekhasan

.NET (DotNet) Software Engineer & Blogger | https://www.developmentsimplyput.com

Learn More
LEARN MORE ABOUT @AHMEDTAREKHASAN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Ahmed Tarek Hasan HackerNoon profile picture
Ahmed Tarek Hasan@ahmedtarekhasan
.NET (DotNet) Software Engineer & Blogger | https://www.developmentsimplyput.com

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite