Skip to main content

Posts

Showing posts with the label Delegate

C# Coveriance

            class Car;             class SportCar : Car;             public delegate Car GetCarDelegate();             public Car GetCar() {}             public SportsCar GetSportsCar() {}             /////////// These both are valid in .NET 2.0 +               GetCarDelegate x = new   GetCarDelegate(GetCar);               GetCarDelegate y = new   GetCarDelegate(GetSportsCar);