|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBankAccount
public class BankAccount
Constructor Summary | |
---|---|
BankAccount()
Creates a bank account with initial balance 0 and account number 1. |
|
BankAccount(double initBalance,
int accountNumber)
Creates a bank account with the given initial balance and given account number. |
Method Summary | |
---|---|
void |
deposit(double amount)
Deposits funds to the account. |
int |
getAccountNumber()
Gets the account number. |
double |
getBalance()
Gets the curent account balance. |
int |
withdraw(double amount)
Withdraws funds from the account if they are available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BankAccount()
public BankAccount(double initBalance, int accountNumber)
initBalance
- Initial balanceaccountNumber
- Account numberMethod Detail |
---|
public double getBalance()
public int withdraw(double amount)
amount
- Withdrawal amount
public void deposit(double amount)
amount
- Deposit amountpublic int getAccountNumber()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |