accountimpl.java

来自「银行bank帐户管理模块」· Java 代码 · 共 30 行

JAVA
30
字号
public class AccountImpl
	extends Bank.AccountPOA
{
	protected float balance;
	
	public AccountImpl(float bal)
	{
		balance = bal;
	}
	
	public void deposit(float amount)
	{
		balance += amount;
	}
	
	public boolean withdraw(float amount)
	{
		if(balance < amount)
			return false;
		else{
			balance -= amount;
			return true;
		}
	}
	
	public float getBalance()
	{
		return balance;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?