📄 creditaccount.java
字号:
package model;import Exception.*;public class CreditAccount extends Account{ private double ceiling; public double getCeiling() { return this.ceiling; } public double setCeiling(double ceiling) { return this.ceiling=ceiling; } public CreditAccount(String password,String name,String personId,String email) { super(password,name,personId,email); } // public void withdraw(double money) throws BusinessException.BalanceNotEnoughException { if(this.getBalance()-money>=(-1)*this.ceiling) this.setBalance(this.getBalance()-money); else { throw new BusinessException.BalanceNotEnoughException("BalanceNotEnoughException--->CreditAccount 您的取款额超出透支额度! "); } } /*public String toString() { return this.getName()+"\t"+this.getPersonId()+"\t"+this.getEmail(); }*/ public boolean equals(Object o) { boolean flag=super.equals(o); if(!flag) return false; CreditAccount c=(CreditAccount)o; if(this.ceiling!=c.ceiling) return false; else return true; } public int hashCode() { // TODO Auto-generated method stub return super.hashCode()^new Double(ceiling).hashCode(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -