吉软-人文精英班-第六次作业

180636_63xW_3858314.png

A

180728_zC47_3858314.png

180759_dZn0_3858314.png错误

应该加mc1.setValue(10);

mc2.setValue(10);

System.out.println(mc1.getValue());

System.out.println(mc2.getValue());

181051_R3vE_3858314.png

package orj.jsoft.homework;

// Account 类

public class Account {
    private long id;          // 账户
    public long getId() {   
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public double getBalance() {
        return balance;
    }
    public void setBalance(double balance) {
        this.balance = balance;
    }
    public String getPassword() {
        return null;
    }
    public void setPassword(String password) {
        
        if(password.length()==6){
            this.password = password;
        }else{
            System.out.println("请修改您的密码");
        }
    }
    private double balance;          //余额
    private String password;          //密码
    
    
}

//  SavingAccount类

package orj.jsoft.homework;

public class SavingAccount extends Account{
    private double interestRate;   //存款利率

    public double getInterestRate() {
        return interestRate;
    }

    public void setInterestRate(double interestRate) {
        if(interestRate>0&&interestRate<0.1){
        this.interestRate = interestRate;
        }else{
            System.out.println("利率不对");
        }
    }
}

//CreditAccount类

package orj.jsoft.homework;

public class CreditAccount extends Account{
    private double creditLine;    //信用额度

    public double getCreditLine() {
        return creditLine;
    }

    public void setCreditLine(double creditLine) {
        this.creditLine = creditLine;
    }
}
 

 

 

 

 

 

 

 

 

转载于:https://my.oschina.net/u/3858314/blog/1819219

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值