文件名称:Example
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:4.58kb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
继承
1. 实验目的
巩固如下概念:
子类的继承性,子类对象的创建过程,成员变量的继承与隐藏,方法的继承与重写。
2. 实验要求
(1)编写一个Java应用程序,除了主类外,该程序中还要定义4个类:People、ChinaPeople、AmericanPeople和BeijingPeople类,要求如下:
People类具有访问权限是protected的double型成员:height和weight,以及public void speakHello()、public void averageHeight()和public void averageWeight()方法。
ChinaPeople是People类的子类,新增了public void chinaGongfu()方法。要求重写父类的public void speakHello()、public void averageHeight()和public void averageWeight()方法。
AmericanPeople是People类的子类,新增了public void americanBoxing()方法。要求重写父类的public void speakHello()、public void averageHeight()和public void averageWeight()方法。
BeijingPeople是ChinaPeople类的子类,新增了public void beijingOpera()方法。要求重写父类的public void speakHello()、public void averageHeight()和public void averageWeight()方法。-Inherit
1. Purpose of the experiment
Consolidation of the following concepts:
Subclass inheritance, sub-class object creation, inheritance and hiding member variables, methods, inheritance and override.
2. Experimental requirements
(1) Write a Java application, in addition to the main class of things, the program also defined four categories: People, ChinaPeople, AmericanPeople and BeijingPeople class, requirements are as follows:
People have access to a protected class of double-type members: height and weight, as well as public void speakHello (), public void averageHeight () and public void averageWeight () method.
ChinaPeople People class is a subclass of added public void chinaGongfu () method. As requested by the parent class public void speakHello (), public void averageHeight () and public void averageWeight () method.
AmericanPeople People class is a subclass of added public void americanBoxing () method. As requested by the parent cl
1. 实验目的
巩固如下概念:
子类的继承性,子类对象的创建过程,成员变量的继承与隐藏,方法的继承与重写。
2. 实验要求
(1)编写一个Java应用程序,除了主类外,该程序中还要定义4个类:People、ChinaPeople、AmericanPeople和BeijingPeople类,要求如下:
People类具有访问权限是protected的double型成员:height和weight,以及public void speakHello()、public void averageHeight()和public void averageWeight()方法。
ChinaPeople是People类的子类,新增了public void chinaGongfu()方法。要求重写父类的public void speakHello()、public void averageHeight()和public void averageWeight()方法。
AmericanPeople是People类的子类,新增了public void americanBoxing()方法。要求重写父类的public void speakHello()、public void averageHeight()和public void averageWeight()方法。
BeijingPeople是ChinaPeople类的子类,新增了public void beijingOpera()方法。要求重写父类的public void speakHello()、public void averageHeight()和public void averageWeight()方法。-Inherit
1. Purpose of the experiment
Consolidation of the following concepts:
Subclass inheritance, sub-class object creation, inheritance and hiding member variables, methods, inheritance and override.
2. Experimental requirements
(1) Write a Java application, in addition to the main class of things, the program also defined four categories: People, ChinaPeople, AmericanPeople and BeijingPeople class, requirements are as follows:
People have access to a protected class of double-type members: height and weight, as well as public void speakHello (), public void averageHeight () and public void averageWeight () method.
ChinaPeople People class is a subclass of added public void chinaGongfu () method. As requested by the parent class public void speakHello (), public void averageHeight () and public void averageWeight () method.
AmericanPeople People class is a subclass of added public void americanBoxing () method. As requested by the parent cl
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Example.doc
Example.class
Example.java
Example.class
Example.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.