public class HistoryBook : Book
{//...code here}
class Program
{
// with covariance one delegate may point to a
method that returns a
// a base class such as Book or a derived type
such as HistoryBook, which
// derives from Book.
public delegate Book GetNewBookDelegate();
//target method of Book delegate
public static Book GetABook()
{ return new Book(); }
//target method of Book delegate
public static HistoryBook GetNewHistoryBook()
{ return new HistoryBook(); }
static void Main(string[] args)
{
GetNewBookDelegate bookDelegate =
new GetNewBookDelegate(GetABook);
Book book = bookDelegate();