|
|||||||||
| 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(java.lang.String anAccountNumber)
Constructs a bank account with a zero balance |
|
BankAccount(java.lang.String anAccountNumber,
double initialBalance)
Constructs a bank account with a given balance |
|
| Method Summary | |
|---|---|
void |
deposit(double amount)
Deposits money into the bank account. |
java.lang.String |
getAccountNumber()
Gets the account number of this bank account. |
double |
getBalance()
Gets the current balance of the bank account. |
java.lang.String |
toString()
Overrudes the toString method Returns a string representation of this account and its values. |
void |
withdraw(double amount)
Withdraws money from the bank account |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BankAccount(java.lang.String anAccountNumber)
anAccountNumber - the account number for this account
public BankAccount(java.lang.String anAccountNumber,
double initialBalance)
anAccountNumber - the account number for this accountinitialBalance - the initial balance| Method Detail |
|---|
public java.lang.String getAccountNumber()
public void deposit(double amount)
amount - the amount to depositpublic void withdraw(double amount)
amount - the amount to withdrawpublic double getBalance()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||