Skip to content

shirin-monzavi/Covariance-and-Contravariance

Repository files navigation

This is a sample project for Covariance and Contravariance in C#. Covariance and contravariance allow us to be flexible when dealing with class hierarchy.

Covariance: Covariance allows you to use a derived class where a base class is expected.

Contravariance: Contravariance is applied to parameters. Contravariance allows a method with the parameter of a base class to be assigned to a delegate that expects the parameter of a derived class.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages