CSharp examples for Custom Type:delegate
A delegate's target method may return a more specific type than described by the delegate. This is called covariance.
delegate return types are covariant.
using System;// w w w . j av a2 s.c om delegate object ObjectRetriever(); class Test { static void Main() { ObjectRetriever o = new ObjectRetriever (RetrieveString); object result = o(); Console.WriteLine (result); // hello } static string RetrieveString() => "hello"; }