?? 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 + -