58,454
社区成员
发帖
与我相关
我的任务
分享
package test;
public class Student {
private String Name;
private String Number;
private int mathScore;
private int EGScore;
private int CMScore;
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public String getNumber() {
return Number;
}
public void setNumber(String number) {
if (number != null && number.length() != 8) {
System.out.println("学号的长度不正确,正确的长度为5位!");
} else {
Number = number;
}
}
public int getMathScore() {
return mathScore;
}
public void setMathScore(int mathScore) {
this.mathScore = mathScore;
}
public int getEGScore() {
return EGScore;
}
public void setEGScore(int score) {
EGScore = score;
}
public int getCMScore() {
return CMScore;
}
public void setCMScore(int score) {
CMScore = score;
}
}