static void Main(string[] args) { Lion lion = new Lion(); Mammal one = lion; //부모타입으로 형변환 one.Move(); Human human = new Human(); Mammal two = human; two.Move(); }
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(); }