43
1
using System;
2
3
public delegate Small covarDel(Big mc);
4
5
public class Program
6
{
7
public static Big Method1(Big bg)
8
{
9
Console.WriteLine("Method1");
10
11
return new Big();
12
}
13
14
public static Small Method2(Big bg)
15
{
16
Console.WriteLine("Method2");
17
18
return new Small();
19
}
20
21
public static void Main(string[] args)
22
{
23
covarDel del = Method1;
24
25
Small sm1 = del(new Big());
26
27
del= Method2;
28
Small sm2 = del(new Big());
29
}
30
}
31
32
public class Small
33
{
34
35
}
36
public class Big: Small
37
{
38
39
}
40
public class Bigger : Big
41
{
42
43
}
Cached Result