package test;
public class Test {
private String name;
private int score;
private boolean sex;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public boolean isSex() {
return sex;
}
public void setSex(boolean sex) {
this.sex = sex;
}
}
在JAVA中定义类成员用属性set和get方法表示
最新推荐文章于 2021-09-17 16:21:50 发布