Inheritance: AbstractTest
示例#1
0
    public static void Main()
    {
        A a = new A(5);

        a.Test();

        D d = new D(8, 3.14F, 500L);

        d.Hello();

        C c = d;

        c.Virtual();

        AbstractTest hello = new AbstractHello();
        AbstractTest world = new AbstractWorld();

        Console.WriteLine(hello.Test());
        Console.WriteLine(world.Test());
        Console.WriteLine(c.f);
        d.Hello();
    }
示例#2
0
    public static void Main()
    {
        A a = new A (5);
        a.Test ();

        D d = new D (8, 3.14F, 500L);
        d.Hello ();

        C c = d;
        c.Virtual ();

        AbstractTest hello = new AbstractHello ();
        AbstractTest world = new AbstractWorld ();

        Console.WriteLine (hello.Test ());
        Console.WriteLine (world.Test ());
        Console.WriteLine (c.f);
        d.Hello ();
    }