示例#1
0
    static void Main(string[] args)
    {
        MyClass1    A = new MyClass1(5);
        MyInterface B = A;

        Console.WriteLine(A.Num());
        Console.WriteLine(B.Num());

        MyClass2    C = new MyClass2(5);
        MyInterface D = C;

        Console.WriteLine(C.Num());
        Console.WriteLine(D.Num());

        Console.ReadKey();
    }