|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectBankAccount
A BankAccount object has a private field to keep track of this account's current balance, and public methods to return and change the balance.
Bank| Constructor Summary | |
BankAccount(int initialBalance)
A constructor for creating a new bank account. |
|
| Method Summary | |
void |
deposit(int amount)
Deposit the amount requested. |
int |
getBalance()
The current account balance. |
void |
withdraw(int amount)
Withdraw the amount requested. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BankAccount(int initialBalance)
initialBalance - the opening balance.| Method Detail |
public void deposit(int amount)
amount - the amount to be deposited.public int getBalance()
public void withdraw(int amount)
amount - the amount to be withdrawn.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||