实验项目 2Java 面对对象程序设计第 2 部分继承与接口[实验目的]1、 掌握 java 继承中父类及其子类的定义方法。2、 掌握子类重写父类同名方法的方法。3、 掌握接口的用法。[实验要求]1、 复习理论教学中所学的内容。2、仔细进行实验预习, 查阅参考书, 书写源程序, 书写实验预习报告。3、仔细总结实验并书写实验报告。[实验课时]2 学时[实验教学方式]学生上机实验, 老师随堂指导。[实验内容]1、 定义父类 People, 分别定义 People 类的子类 ChinaPeople, AmericanPeople 和 BeijingPeople 并分别重写父类中的各个方法。最后在主方法中分别创立各子类的对象并调用各自的方法打印输出信息。该程序的模板代码如下: 请将其补充完整并调试运行。classPeople{protecteddoubleweight,height;publicvoidspeakHello(){System.out.println("yayawawa");}publicvoidaverageHeight(){height=173;System.out.println("averageheight:"+height);}publicvoidaverageWeight(){weight=70;System.out.println("averageweight:"+weight);}}classChinaPeopleextendsPeople{【代码 1】//重写 publicvoidspeakHello()方法, 要求输出类似”你好, 吃了吗”这样的//汉语信息【代码 2】//重写 publicvoidaverageHeight()方法, 要求输出类似//”中国人的平均身高: 168.78 厘米”这样的汉语信息【代码 3】//重写 publicvoidaverageWeight()方法, //要求输出类似”中国人的平均体重: 65 公斤”这样的汉语信息publicvoidchinaGongfu(){【代码 4】//输出中国武术的信息, 例如: "坐如钟,站如松,睡如弓"等}}classAmericanPeopleextendsPeople{【代码 5】//重写 publicvoidspeakHello()方法, 要求输出类似//”Howdoyoudo”这样的英语信息。【代码 6】//重写 publicvoidaverageHeight()方法【代码 7】//重写 publicvoidaverageWeight()方法publicvoidamericanBoxing(){【代码 8】//输出拳击的信息, 例如, ”直拳”、 ”钩拳”等}}classBeijingPeopleextendsChinaPeople{【代码 9】//重写 publicvoidspeakHello()方法, 要求输出类似”您好”这样的汉语信息【代码 10】//重写 publicvoidaverageHeight()方法【代码 11】//重写 publicvoidaverageWeight()方法publicvoidbeijingOpera(){【代码 12】//输出京剧的信息}}publicclassExample{publicstaticvoidmain(Stringargs[]){ChinaPeoplechinaPeople=newChinaPeople();Ameri...