步骤 1:项目准备
省略......
步骤 2:完成实体类 Member
public Member(String name, String pwd, float score, int rank) {
this.name = name;
this.pwd = pwd;
this.score = score;
this.rank = rank;
}
public Member() {
}
步骤 3:完成实体类 Goods
//请修改该方法,并且在赋值时,商品数量不能超过100
public void setNum(int num) {
if(num<=100){
this.num = num;
}
}