重写父类
创建如下三个类:(People类中的三个方法分别输出一些信息,ChinaPeople和AmericanPeople类重写父类的三个方法)。
People.java👇
package work.second;
public class People {
protected double height;
protected double weight;
public People(double height,double weight){
this.height=height;
this.weight=weight;
}
public void speakHello(){
System.out.println("打招呼");
};
public void averageHeight(){
System.out.println("平均身高为:"+height)