savingaccount.java
来自「银行的一个管理系统」· Java 代码 · 共 23 行
JAVA
23 行
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 + =
减小字号Ctrl + -
显示快捷键?