?? account.java
字號:
package banking.domain;
public class Account {
protected double balance;
public Account(double init_balance){
this.balance = init_balance;
}
public double getBalance(){
return this.balance;
}
public boolean deposit(double amt){
if (amt>0.0){
this.balance += amt;
return true;
}
return false;
}
public void withdraw(double amt) throws OverdraftException{
if (this.balance-amt>0.0){
this.balance -= amt;
}
else{
throw new OverdraftException("Insufficient funds", amt-this.balance);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -