creditaccount.java

来自「电子银行系统」· Java 代码 · 共 48 行

JAVA
48
字号
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 + =
减小字号Ctrl + -
显示快捷键?