|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBankAccount
public class BankAccount
A bank account has a balance that can be changed by deposits and withdrawals.
Constructor Summary | |
---|---|
BankAccount()
Constructs a bank account with a zero balance. |
|
BankAccount(double initialBalance)
Constructs a bank account with a given balance. |
Method Summary | |
---|---|
void |
deposit(double amount)
Deposits money into the bank account. |
double |
getBalance()
Gets the current balance of the bank account. |
double |
getMeasure()
Computes the measure of the object. |
void |
withdraw(double amount)
Withdraws money from the bank account. |
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 initialBalance)
initialBalance
- the initial balanceMethod Detail |
---|
public void deposit(double amount)
amount
- the amount to depositpublic void withdraw(double amount)
amount
- the amount to withdrawpublic double getBalance()
public double getMeasure()
Measurable
getMeasure
in interface Measurable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |