使用多态描述动物的运动
一、语言和环境 | |
A、实现语言 | |
C# | |
B、环境要求 | |
Visual Studio 2012 二、功能要求 在森林中生活着很多小动物,现创建控制台程序来描述各种动物的运动。如图-3所示。 图-3 抽象方法实现多态 要求: 1、 不同的动物都有执行运动的功能。 2、 3种不同动物对象保存在一个泛型集合中。 3、 不能使用判断语句判断动物类型。 4、 使用抽象方法实现不同动物的多态,不可以使用方法的重载。
|
使用多态描述动物的运动
一、语言和环境 | |
A、实现语言 | |
C# | |
B、环境要求 | |
Visual Studio 2012 二、功能要求 在森林中生活着很多小动物,现创建控制台程序来描述各种动物的运动。如图-3所示。 图-3 抽象方法实现多态 要求: 1、 不同的动物都有执行运动的功能。 2、 3种不同动物对象保存在一个泛型集合中。 3、 不能使用判断语句判断动物类型。 4、 使用抽象方法实现不同动物的多态,不可以使用方法的重载。
|