📄 savingaccount.java
字号:
package com.shunshi.bam.entity.model;
import com.shunshi.bam.exception.*;
public class SavingAccount extends Account{
public SavingAccount(){
super();
}
public SavingAccount(String password,String name,String personId,String email){
super(password,name,personId,email);
}
@Override
public void withdraw(double money)throws BalanceSmalerZeroException,BalanceNotEnoughException{
if(money<0)throw new BalanceSmalerZeroException("取钱金额不能是负数");
if(this.getBalance()<money){
throw new BalanceNotEnoughException("对不起,你的余额不足!");
//System.out.println("对不起,你的余额不足!");
//return this.getBalance();
}
this.setBalance(this.getBalance()-money);
//return this.getBalance();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -