package com.yj.banking;
/**
 * 
 * <p>Title: Account</p>
 * <p>Description: ÓÃ»§ÕË»§Àà</p>
 * <p>Company: </p> 
 * @author yaojun
 * @date 2017Äê6ÔÂ19ÈÕ ÏÂÎç4:15:26
 */
public class Account {
	/**
	 * ÒøÐÐÕË»§µ±Ç°Óà¶î
	 */
	protected double balance;

	public Account(double balance) {
		super();
		this.balance = balance;
	}
	
	/**
	 * 
	 * @Title: getBalance 
	 * @Description: »ñÈ¡ÕË»§µ±Ç°Óà¶î
	 * @return double
	 * @throws
	 */
	public double getBalance(){
		return this.balance;
	}
	
	/**
	 * 
	 * @Title: deposit 
	 * @Description: ÍùÕË»§Àï´æÇ®
	 * @param amt
	 * @return boolean
	 * @throws
	 */
	public boolean deposit(double amt){
		this.balance += amt;
		return true;
	}
	
	/**
	 * 
	 * @Title: withdraw 
	 * @Description: ´ÓÕË»§ÖÐÈ¡Ç®
	 * @param amt
	 * @return boolean
	 * @throws
	 */
	public boolean withdraw(double amt){
		if(amt > this.balance){
			System.out.println("Óà¶î²»×ã");
			return false;
		}else{
			this.balance -= amt;
			return true;
		}
	}
	
}
