一.虚方法实现多态 1,创建一个people基类 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 继承之抽象类 { public class people { public virtual void SayHi()//定义一个SayHi的虚方法 { } } } 2.创建两个子类Student.cs和Teacher.cs继承基类people using S…
创建如下三个类:(People类中的三个方法分别输出一些信息,ChinaPeople 和AmericanPeople类重写父类的三个方法). ackage com.chuoji.text01; public class People { protected double height; protected double weight; public double getHeight() { return height; } public void setHeight(double height)…