示例#1
0
    static void Main()
    {
        cDog    ob2 = new cDog();
        cMammal ob1 = (cMammal)ob2;

        ob1.speak();
        ob2.speak();
    }
    static void Main()
    {
        cDog    ob2 = new cDog();
        cMammal ob1 = (cMammal)ob2;

        //Notice that "Grunt" is still outputted EVEN though it is a dog?
        ob1.speak();
        ob2.speak();
    }