文件名称:Inherited-use
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Text]
- 上传时间:
- 2012-12-10
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- 李**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
声明一个人类Person,属性有姓名,性别,出生年月,民族等信息,该类有两个构造方法Person()和Person(姓名,性别,出生年月,民族);
本科生类Undergraduate继承Person,增加了学号,专业,班级等信息,有两个构造方法Undergraduate()和Undergraduate(姓名,性别,出生年月,民族,学号,专业,班级);
研究生类Graduate继承本科生类Undergraduate,又增加了导师姓名,有两个构造方法Graduate()和Graduate(姓名,性别,出生年月,民族,学号,专业,班级,导师)。
创建一个研究生类Graduate的对象,理解继承的用法,输出该研究生的信息。
-Declare a human Person, attribute has name, sex, date of birth, ethnic, and other information, the class has two structure method () Person and Person (name, sex, date of birth, and national)
Undergraduate class Undergraduate inheritance Person, increased student id, professional, the information such as class, there are two construction methods Undergraduate () and Undergraduate (name, sex, date of birth, and nationality, student id, professional, class)
The Graduate student class Graduate inheritance Undergraduate class Undergraduate, and add the name of the teacher, there are two construction methods Graduate () and Graduate (name, sex, date of birth, and nationality, student id, professional, class, teacher).
Create a Graduate student Graduate class object, understand the usage of the inheritance, the output of the Graduate student information.
本科生类Undergraduate继承Person,增加了学号,专业,班级等信息,有两个构造方法Undergraduate()和Undergraduate(姓名,性别,出生年月,民族,学号,专业,班级);
研究生类Graduate继承本科生类Undergraduate,又增加了导师姓名,有两个构造方法Graduate()和Graduate(姓名,性别,出生年月,民族,学号,专业,班级,导师)。
创建一个研究生类Graduate的对象,理解继承的用法,输出该研究生的信息。
-Declare a human Person, attribute has name, sex, date of birth, ethnic, and other information, the class has two structure method () Person and Person (name, sex, date of birth, and national)
Undergraduate class Undergraduate inheritance Person, increased student id, professional, the information such as class, there are two construction methods Undergraduate () and Undergraduate (name, sex, date of birth, and nationality, student id, professional, class)
The Graduate student class Graduate inheritance Undergraduate class Undergraduate, and add the name of the teacher, there are two construction methods Graduate () and Graduate (name, sex, date of birth, and nationality, student id, professional, class, teacher).
Create a Graduate student Graduate class object, understand the usage of the inheritance, the output of the Graduate student information.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Inherited use.txt