文件名称:StuTest
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.55kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
声明Stu类。属性包括学号、姓名、英语成绩、数学成绩、计算机成绩和总成绩。方法包括构造方法、get方法、set方法、toString方法、equals方法、compare方法(比较两个学生的总成绩,结果分大于、小于、等于)、sum方法(计算总成绩)和testScore方法(计算评测成绩,即平均成绩)。
声明StuXW(学习委员)类为Student类的子类。在StuXW类中增加责任属性,并重写testScore方法,使得学习委员的测评成绩为平均成绩+3分。
声明StuBZ(班长)类为Student类的子类。在StuXW类中增加责任属性,并重写testScore方法,使得班长的测评成绩为平均成绩+5分。
声明测试类完成对多态性的测试:
在main方法中声明Student类的数组(含五个元素)。
生成五个对象存入数组,其中三个Stu类的对象、一个StuXW类的对象、一个StuBZ类的对象。
将方法testScore()发送给数组的每一个元素,输出结果,并分析具体执行的是哪一个类中的方法
-Stu class declaration. Properties include the student number, name, English scores, math scores, computer score and total score. Method includes the construction method, get method, set method, toString method, equals method, compare method (compare the overall performance of two students, the results are greater than, less than, equal to), sum method (Calculation of total score) and testScore methods ( computing performance evaluation, an average of results).
Statement StuXW (learning members) class as a subclass of Student. Increased responsibility in StuXW class attributes, and override testScore method makes learning members of the evaluation results for the average grade of+3 points.
Statement StuBZ (monitor) class as a subclass of Student. Increased responsibility in StuXW class attributes, and override testScore method makes squad leader of the evaluation results for the average grade of+5 points.
Statement on the polymorphism test class to complete the test:
Declared in
声明StuXW(学习委员)类为Student类的子类。在StuXW类中增加责任属性,并重写testScore方法,使得学习委员的测评成绩为平均成绩+3分。
声明StuBZ(班长)类为Student类的子类。在StuXW类中增加责任属性,并重写testScore方法,使得班长的测评成绩为平均成绩+5分。
声明测试类完成对多态性的测试:
在main方法中声明Student类的数组(含五个元素)。
生成五个对象存入数组,其中三个Stu类的对象、一个StuXW类的对象、一个StuBZ类的对象。
将方法testScore()发送给数组的每一个元素,输出结果,并分析具体执行的是哪一个类中的方法
-Stu class declaration. Properties include the student number, name, English scores, math scores, computer score and total score. Method includes the construction method, get method, set method, toString method, equals method, compare method (compare the overall performance of two students, the results are greater than, less than, equal to), sum method (Calculation of total score) and testScore methods ( computing performance evaluation, an average of results).
Statement StuXW (learning members) class as a subclass of Student. Increased responsibility in StuXW class attributes, and override testScore method makes learning members of the evaluation results for the average grade of+3 points.
Statement StuBZ (monitor) class as a subclass of Student. Increased responsibility in StuXW class attributes, and override testScore method makes squad leader of the evaluation results for the average grade of+5 points.
Statement on the polymorphism test class to complete the test:
Declared in
(系统自动生成,下载前可以参看下载内容)
下载文件列表
StuTest.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.