Why the concept of "Covariance" and "Contravariance" are applicable while implementing the methods o
- by Amy
The use case is some what like this:
public class SomeClass: IClonable
{
// Some Code
//Implementing interface method
Public object Clone()
{
//Some Clonning Code
}
}
Now my question is "Why is it not possible to use "SomeClass(As it is derivd from objec)" as a return type of Clone() method if we consider the Funda's of Covariance and Contravariance.
Can somebody explain me the reason behind this implemementaion of Microsoft ????