黑马程序员技术交流社区
标题:
学生类
[打印本页]
作者:
林明辉
时间:
2016-4-25 23:20
标题:
学生类
package com.heiam.bean;
public class Student {
private String name;
private int chinese;
private int math;
private int english;
private int sum;
public Student() {
super();
}
public Student(String name, int chinese, int math, int english) {
super();
this.name = name;
this.chinese = chinese;
this.math = math;
this.english = english;
this.sum = this.chinese + this.math + this.english;
}
public int getSum() {
return sum;
}
public String toString() {
return name + "," + chinese + "," + math + "," + english + "," + sum;
}
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2