资源介绍
public class Student {//学生类
private int on;//定义并封装编号
private String name;
private int age;
private double java;
private double c_shar;
private double html;
private double sql;
private double sum;
private double avg;
public void setOn(int on){
this.on=on;
}
public int getOn(){
return this.on;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return this.age;
}
public void setAge(int age) {
this.age = age;
}
public double getJava() {
return this.java;
}
public void setJava(double java) {
this.java = java;
}
public double getC_shar() {
return this.c_shar;
}
public void setC_shar(double c_shar) {
this.c_shar = c_shar;
}
public double getHtml() {
return this.html;
}
public void setHtml(double html) {
this.html = html;
}
public double getSql() {
return this.sql;
}
public void setSql(double sql) {
this.sql = sql;
}
public double getSum() {
return this.sum;
}
public void setSum() {
this.sum =this.java+this.c_shar+this.html+this.sql;
}
public double getAvg() {
return this.avg;
}
public void setAvg() {
this.avg =(this.java+this.c_shar+this.html+this.sql)/4;
}
public String toString(){
String msg=this.on+"\t"+this.name+"\t"+this.age+"\t"+this.java+"\t"+this.c_shar+"\t"+this.html+"\t"+this.sql+"\t"+this.sum+"\t"+this.avg;
return msg;
}
}