示例#1
0
        static void Main(string[] args)
        {
            Lion   lion = new Lion();
            Mammal one  = lion; //부모타입으로 형변환

            one.Move();

            Human  human = new Human();
            Mammal two   = human;

            two.Move();
        }
示例#2
0
文件: Program.cs 项目: luputona/CS01
        static void Main(string[] args)
        {
            Mammal one = new Mammal();

            one.Move();

            Lion lion = new Lion();

            lion.Move();

            Whale whale = new Whale();

            whale.Move();

            Human human = new Human();

            human.Move();

            Lion   lion2 = new Lion();
            Mammal one2  = lion2; //부모타입으로 형변환

            one2.Move();
        }